Re: regex observation & question regarding re:escape()
- Posted by mattlewis (admin) Sep 21, 2016
- 1537 views
Spock said...
mattlewis said...
jessedavis said...
I was particularly interested in the second entry format that uses the #/.../ format because it has the potential to ease the confusion factor.
When using regular expressions, I'd recommend using the ` ` backtick style quotes because you don't have to escape anything ...
Matt
Just to clarify - 'anything' is referring to characters in a text string. Special characters treated as literals in the regex itself must still be escaped.
Yes, sorry. I meant that you don't have to escape any characters for the purposes of euphoria reading in the text. So:
"foo\\.txt" -- could be written as: `foo\.txt`
You need to escape the period because that's a special character in regular expressions. But you don't need to escape the backslash itself.
Matt