Thomas Dalton wrote:
I've also
been too lazy to experiment in my test wiki. I've been
stymied by the purpose of the four slashes in the "A-Z\\\\^" part of
that string. It might be obvious to some but not to me. Is there a
need to double many of the \s here?
I would imagine the doubling of \'s is for escaping purposes, although
why you'd end up with 4 in a row, I've no idea. I never did get the
hang of regular expressions.
\\ in a string literal means \ in the represented string.
\\ in a regular expression means to match \ in the searched string.
Thus, \\\\ in a string literal *representation of* a regular expression
means to match \ in the searched string.
Yeah, it's ugly. Welcome... to programming! :D
-- brion