panacekcz / checker-framework

Pluggable type-checking for Java
http://checkerframework.org/
Other
0 stars 0 forks source link

Lower bounds for non-optional group in java.util.regex.Matcher #14

Open panacekcz opened 7 years ago

panacekcz commented 7 years ago

If a group in regex must always match (for example in "'(a-z*)'"), then start and end always return non-negative index for that group. This would require analysis of the regular expression, associating it with the matcher, and using the information when start or end is called with a compile-time constant argument.