Regexp, Allow Quantifiers on zero-length tests?
Allow quantifiers on zero-length tests?
This is a Java compatibility question.
Java allows things like "`^`" or "\b" to appear in patterns.
It doesn't make any sense to repeat a test for being on a boundary position; any appearances of these constructs in patterns probably are an error or a misunderstanding by the author of the pattern.
ICU started to match Java, with quantifiers allowed on '`^`' and '$'. But there are many more, including look-ahead and look-behind.
ICU should be consistent with itself, and either allow these everywhere, or disallow them everywhere. Disallow seems best -
They don't do anything useful, and are likely user errors.
Allowing would require care, to avoid any possibility of sending the match engine
into a loop on the zero length (no progress) match.
Historically, ICU dis-allowed these.