
7stud
Enthusiast
Jan 20, 2013, 12:38 PM
Views: 454
|
|
Re: [lovinPerl] A simple regex question
|
|
|
One other thing...escaping things in regexes makes them very hard to read. One trick is to put the character inside a character class. Inside a character class, the special regex characters lose their special meaning. Also, using some whitespace to separate the parts of your regex (coupled with the x modifier) will make your regexes easier to read:
if ( /(\w) \1 [*] | (\w) [*] \1/x )
(This post was edited by 7stud on Jan 20, 2013, 12:39 PM)
|