http://qs1969.pair.com?node_id=326723


in reply to regex logical equivalence?

From your other node you should appreciate the need for readability in regex. The guy that wrote the original regex didn't think much about readability at all.

there are a couple of things you can do as well as using \X, like:

different delimiters

in a regex with a couple of escapes like this /\@\\\// you can change the /../delimiters to any character you want, as long as they are paired, like this !\@\\\/! or #\@\\\/#

block quoting

in a regex with lots of escaped characters use \Q...\E notation. This works in the same way that single quotes work for strings, meaning the characters are interpeted exactly as they are written - !\Q$@.\^[{\E! is more readable than !\$\@\.\\\^\[\{!

<lecture mode = on>

Finally as others have already pointed out, Perl's regex are very powerful and as such difficult to "just pick up", you have to read up on regex to even begin to understand how to use them - as a beginner you should probably read these first:

perlrequick Perl regular expressions quick start perlretut Perl regular expressions tutorial perlfaq6 Regexes
</lecture mode>

----Signature: You spend twenty years learning the spell that makes nude virgins appear in your bedroom, and then you're so poisoned by quicksilver fumes and half-blind from reading old grimoires that you can't remember what happens next.