Regex literal expressions


I’d like to request a regex literal feature.

val pattern2:Regex = /test-\d/i;

The main reason I feel it’s important is that without it, escaping gets unreadable quickly.


Are you aware of raw strings?

val r = Regex("""\d+""")

I never liked special strings for regex like in Perl.


Ah, thanks. For some reason I was thinking raw strings still used \ as an escape character. So the only thing you’d need to escape is the $. I think that’ll be fine.
I liked regex literals in AS3, I miss it :).


Note that escaping the $ in raw strings is done using