in reply to Re: Re: combining RegEx
in thread combining RegEx
Since parentheses have two functions (to affect precedence and to cause capture of a submatch (e.g. into $1)) and you often want to do the former but not the latter, there is a special form of parentheses that don't capture: (?: before and ) after. This odd way of extending regex syntax was chosen since (? regex was otherwise meaningless and illegal.
Does that help?
You can install modules YAPE::Regex and YAPE::Regex::Explain and say (for example) print YAPE::Regex::Explain->new("(ease)?")->explain() to get a verbose blow-by-blow description of what a particular regex does.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: combining RegEx
by Anonymous Monk on Nov 04, 2003 at 18:44 UTC |