
shawnhcorey
Enthusiast

Sep 17, 2008, 12:39 PM
Post #2 of 2
(2500 views)
|
|
Re: [per'l'over] COuld you kindly explain the meaning of REGEXP
[In reply to]
|
Can't Post
|
|
~ m/(always\s*\@(?:(?:(?!\n\n).)*)\n\n)/sig) what does the above REGEXP do and explain it please Adding whitespace to make it more readable: m/ ( always \s* \@ (?: (?: (?! \n \n ) . )* ) \n \n ) /sigx m/ == start match ( == start capture group always == match the string 'always' \s* == match zero, one or more whitespace characters \@ == match the character '@' (?: == group but don't capture (?: == group but don't capture (?! == negative look-ahead but don't match \n == match a LF character \n == match a LF character ) == end group . == match any character )* == end group matching zero, one or more of the group \n == match a LF character \n == match a LF character ) == end capture group / == end match s == allow '.' to match LF character too i == ignore case g == repeat match as often as possible x == ignore whitespace in pattern It says to match always, followed by whitespace, followed by '@', not followed by a single blank line but followed by: 1) some lines, followed by a blank line; or 2) two blank lines. __END__ I love Perl; it's the only language where you can bless your thingy. Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib. Get Markup Help. Please note the markup tag of "code".
|