in reply to Regular expression to English translation
use YAPE::Regex::Explain; print YAPE::Regex::Explain->new(qr/this.*(?:that)?(?!another)/) ->explain; __output__ The regular expression: (?-imsx:this.*(?:that)?(?!another)) matches as follows: NODE EXPLANATION ---------------------------------------------------------------------- (?-imsx: group, but do not capture (case-sensitive) (with ^ and $ matching normally) (with . not matching \n) (matching whitespace and # normally): ---------------------------------------------------------------------- this 'this' ---------------------------------------------------------------------- .* any character except \n (0 or more times (matching the most amount possible)) ---------------------------------------------------------------------- (?: group, but do not capture (optional (matching the most amount possible)): ---------------------------------------------------------------------- that 'that' ---------------------------------------------------------------------- )? end of grouping ---------------------------------------------------------------------- (?! look ahead to see if there is not: ---------------------------------------------------------------------- another 'another' ---------------------------------------------------------------------- ) end of look-ahead ---------------------------------------------------------------------- ) end of grouping ----------------------------------------------------------------------
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regular expression to English translation
by Wassercrats (Initiate) on Nov 27, 2003 at 12:33 UTC | |
by broquaint (Abbot) on Nov 27, 2003 at 13:28 UTC | |
by Wassercrats (Initiate) on Nov 27, 2003 at 15:41 UTC | |
by bsb (Priest) on Nov 28, 2003 at 03:41 UTC |