> How about (a*(b|c)d*){1}+? (Yeah, it's ugly...)
Yup, it is. But that's why we keep the uglier but more appropriate (?>) around in Perl. Occasionally, it's the right/only operator for the job.
As best as I can figure, java thinks it's being clever by using the possessive instead of (?>), which is dumb, since it doesn't cover the simple case of exactly one match. We can do better than that :-)
In reply to Re: Re(4): Possessive Quantifiers
by Ferret
in thread Possessive Quantifiers
by Ferret
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |