Is it true that ($match){1}+ equals to simply $match? Yes, and the + does nothing here, as you can see with use warnings:
That's only true because you the OP included a quantifier in the embedded regex; and you get 3 fails because your anchors guarantee the regex used couldn't succeed (which doesn't seem like a useful test?)
This shows that {n}+ is a valid quantifier:
use strict; use warnings; chomp(my $match = <DATA>); chomp( $_ = <DATA>); for my $regex ( "($match){1}+", "($match){1}", "($match)", "($match)+", "($match)+?", ) { print qw(FAIL SUCCESS)[ !! m/$regex/ ], "\n" } __DATA__ (?:a|b) bbab
C:\test>junk37 SUCCESS SUCCESS SUCCESS SUCCESS SUCCESS
In reply to Re^5: about style: use possessive or atomic?
by BrowserUk
in thread about style: use possessive or atomic?
by rsFalse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |