
KevinR
Veteran

Jul 20, 2008, 10:42 AM
Post #2 of 2
(9093 views)
|
the pattern in the center is a negated character class: [^)]* the ^ is not the beginning of line anchor in this context, it means to not match whatever is inside the square brackets, in this case there is a sinlge right parenthesis ')'. So essentially it means to match zero or more of anything except a ')'. Its appears to be capturingwhatever is inside of double parenthesis:
$_ = '((this will match))'; /\((\([^)]*\))\)/ print $1; $1 is what is matched by the grouping parenthesis in the regexp. -------------------------------------------------
|