3 ms·
I believe they mean adding a literal syntax specifically for regular expressions, ala perl and ruby, so you could write something like: print(/\d{4}/.sub("2021
by SrslyJosh 6y ago
I believe they mean adding a literal syntax specifically for regular expressions, ala perl and ruby, so you could write something like:
print(/\d{4}/.sub("2021"))
The backslash makes that example a little ugly, but maybe a delimiter other than "/" would work better. It's too bad that r"" is already taken for raw strings.
- nerdponx 6y agoCould be x"" for regeX or p"" for Pattern