info.codesaway.util.regex.RegExPlusSupport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of regexplus Show documentation
Show all versions of regexplus Show documentation
Extends Java's regular expression syntax by adding support for additional Perl and .NET syntax.
The newest version!
package info.codesaway.util.regex;
/**
* Used to store the last regex match.
*
* RegExPlus counterpart for the Groovy class, RegexSupport (org.codehaus.groovy.runtime.RegexSupport),
* which stores the last java.util.regex.Matcher object.
*/
public final class RegExPlusSupport {
private static final ThreadLocal CURRENT_MATCHER = new ThreadLocal<>();
public static Matcher getLastMatcher() {
return CURRENT_MATCHER.get();
}
public static Matcher setLastMatcher(final Matcher matcher) {
CURRENT_MATCHER.set(matcher);
return matcher;
}
}