-
Enhancement
-
Resolution: Unresolved
-
P3
-
None
-
None
-
None
The Matcher operations such as find(), match() and lookingAt() can take long time to complete. However, since the Matcher class was not designed to respond to interruption, there is no way to stop those long-running operations.
It is proposed to introduce a separate class, java.util.regex.InterruptibleMatcher, which will mostly mimic the interface of the non-interruptible java.util.regex.Matcher, but will provide methods find(), match() and lookingAt() that will throw InterruptibleException, if the thread executing those is interrupted.
Additionally, there will be provided variants of find(long, TimeUnit), match(long, TimeUnit) and lookingAt(long, TimeUnit), that will allow to specify a timeout.
It is proposed to introduce a separate class, java.util.regex.InterruptibleMatcher, which will mostly mimic the interface of the non-interruptible java.util.regex.Matcher, but will provide methods find(), match() and lookingAt() that will throw InterruptibleException, if the thread executing those is interrupted.
Additionally, there will be provided variants of find(long, TimeUnit), match(long, TimeUnit) and lookingAt(long, TimeUnit), that will allow to specify a timeout.
- relates to
-
JDK-7178072 java.util.regex: make Matcher interruptible
-
- Closed
-
-
JDK-8054028 Regex Matcher not interruptable
-
- Closed
-