Also, /begin.*end/ will allow a begin followed by an end, which will allow an item like beginbeginend to pass with no problems;So does your regex:
Abigail$re = /begin (?: (?>[^be]*) |(??{ $re }) | [be] )* end/x; "begin begin end" =~ /$re/ and print "<$&>\n"; __END__ <begin begin end>
In reply to Re: Matching nested begin/ends
by Abigail-II
in thread Matching nested begin/ends
by Abigail-II
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |