It is also possible to use Scala's string interpolation feature to create elaborate extractors (pattern matchers), as perhaps most famously employed in the quasiquotes API of Scala macros.
Given that n"p0${i0}p1" desugars to new StringContext("p0", "p1").n(i0), it is p...