Actually I like /x, mostly actually to comment properly which parts of the regexp I want to capture:
$exp=~ m{^([\w]+|\*)\s* # a name or '*' ($1) (?: # an optional condition in brackets \[\s*(\w+) # name ($2) \s*=\s* # = "([^"]*)" # "string" ($3) \s*\])?}x;
I really find it much easier to maintain later if I know where in the regexp I capture a specific value.
In reply to Re: Proper use of //x
by mirod
in thread Proper use of //x
by swiftone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |