Package org.radeox.regex
Class Matcher
- java.lang.Object
-
- org.radeox.regex.Matcher
-
- Direct Known Subclasses:
JdkMatcher
public abstract class Matcher extends Object
-
-
Constructor Summary
Constructors Constructor Description Matcher()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancontains()Test if a regular expression matches parts of the inputstatic Matchercreate(String input, Pattern pattern)Create a new matcher object, depending on the implementationabstract booleanmatches()Test if a regular expression matches the complete inputabstract Stringsubstitute(String substitution)Replace all matches in the input with a string substitution.abstract Stringsubstitute(Substitution substitution)Replace all matches in the input with a substitution.
-
-
-
Method Detail
-
create
public static Matcher create(String input, Pattern pattern)
Create a new matcher object, depending on the implementation- Parameters:
input- Input to match regular expressions againspattern- Regular expression pattern- Returns:
- A Matcher implementation
-
substitute
public abstract String substitute(Substitution substitution)
Replace all matches in the input with a substitution. For every match substition.handleMatch is called.- Parameters:
substitution- Code which handles every substitution- Returns:
- String with all matches substituted
-
substitute
public abstract String substitute(String substitution)
Replace all matches in the input with a string substitution.- Parameters:
substitution- String to replace all matches- Returns:
- String with all matches substituted
-
matches
public abstract boolean matches()
Test if a regular expression matches the complete input- Returns:
- True if the regex matches the complete input
-
contains
public abstract boolean contains()
Test if a regular expression matches parts of the input- Returns:
- True if the regex matches a part of the input
-
-