Class RegExPatternMatcher
java.lang.Object
org.apache.shiro.util.RegExPatternMatcher
- All Implemented Interfaces:
PatternMatcher
PatternMatcher implementation that uses standard java.util.regex objects.- Since:
- 1.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if regex match should be case-insensitive.booleanSimple implementation that merely uses the default pattern comparison logic provided by the JDK.voidsetCaseInsensitive(boolean caseInsensitive) Adds the Pattern.CASE_INSENSITIVE flag when compiling patterns.
-
Constructor Details
-
RegExPatternMatcher
public RegExPatternMatcher()
-
-
Method Details
-
matches
Simple implementation that merely uses the default pattern comparison logic provided by the JDK. This implementation essentially executes the following:Pattern p = Pattern.compile(pattern, Pattern.DOTALL); Matcher m = p.matcher(source); return m.matches();
- Specified by:
matchesin interfacePatternMatcher- Parameters:
pattern- the pattern to match againstsource- the source to match- Returns:
trueif the source matches the required pattern,falseotherwise.
-
isCaseInsensitive
Returns true if regex match should be case-insensitive.- Returns:
- true if regex match should be case-insensitive.
-
setCaseInsensitive
Adds the Pattern.CASE_INSENSITIVE flag when compiling patterns.- Parameters:
caseInsensitive- true if patterns should match case-insensitive.
-