Note that the output for your first example is 3, 8 instead of 3, 3. The appropiate RegEx for that would have been /[XYZ]{3}([A-Za-z]{0,21}?)[ABC]{3}/ (non-greedy quantifiers).perl -e "'FGTXYZGTFABCGHABC' =~ /[XYZ]{3}([A-Za-z]{0,21})[ABC]{3}/; print $-[0] . ', ' . length($1);" __OUTPUT__ 3, 8
In reply to Re: nested pattern matching
by CombatSquirrel
in thread nested pattern matching
by vinforget
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |