It may help to talk it through in words first. The pattern you're looking at is:
Now just put those elements together in a regex:
if( $line =~ m[ \$\$ # two dollar signs \( # open paren ([^)]+) # capture until closed paren \) # close paren (.*) # capture the rest, if any ]x ){ # do stuff with $1 and $2 }
Aaron B.
Available for small or large Perl jobs; see my home node.
In reply to Re^3: regex needed
by aaron_baugher
in thread regex needed
by doubledecker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |