Package ortus.boxlang.runtime.util
Class RegexBuilder.RegexMatcher
java.lang.Object
ortus.boxlang.runtime.util.RegexBuilder.RegexMatcher
- Enclosing class:
RegexBuilder
The RegexMatcher class is used to match a pattern against an input string
by either using a pre-complied pattern or a string pattern that will be compiled on the fly.
-
Method Summary
Modifier and TypeMethodDescriptionget()Get's the input string as modified by the matcherCompile the pattern from the given string with case sensitivityCompile the pattern from the given stringCompile the pattern from the given stringCompile the pattern from the given patternmatcher()Get the matcher instance for the input string and patternmatches()Check if the input string matches the patternreplaceAll(String replacement) Replace all occurrences of the pattern in the input string with the replacement stringreplaceAll(Pattern pattern, String replacement) Replace all occurrences of the pattern in the input string with the replacement stringreplaceAllAndGet(String replacement) Replace all occurrences of the pattern in the input string with the replacement stringreplaceAllAndGet(Pattern pattern, String replacement) Replace all occurrences of the pattern in the input string with the replacement stringreplaceFirst(String replacement) Replace first occurrence of the pattern in the input string with the replacement stringreplaceFirst(Pattern pattern, String replacement) Replace first occurrence of the pattern in the input string with the replacement stringreplaceFirstAndGet(String replacement) Replace first occurrence of the pattern in the input string with the replacement stringreplaceFirstAndGet(Pattern pattern, String replacement) Replace first occurrence of the pattern in the input string with the replacement stringreset()Reset the input string to the original value
-
Method Details
-
match
Compile the pattern from the given pattern- Parameters:
pattern- The pattern to compile- Returns:
- The matcher instance
-
match
Compile the pattern from the given string with case sensitivity- Parameters:
pattern- The pattern to compile- Returns:
- The matcher instance
-
match
Compile the pattern from the given string- Parameters:
pattern- The pattern to compilenoCase- Whether the pattern should be case insensitive or not- Returns:
- The matcher instance
-
match
Compile the pattern from the given string- Parameters:
pattern- The pattern to compilenoCase- Whether the pattern should be case insensitive or notflags- The flags to use when compiling the pattern- Returns:
- The matcher instance
-
matches
Check if the input string matches the pattern- Returns:
- True if the input string matches the pattern, false otherwise
-
matcher
Get the matcher instance for the input string and pattern- Returns:
- The matcher instance
-
replaceAll
Replace all occurrences of the pattern in the input string with the replacement string- Parameters:
replacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceAll
Replace all occurrences of the pattern in the input string with the replacement string- Parameters:
pattern- The pattern to match againstreplacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceFirst
Replace first occurrence of the pattern in the input string with the replacement string- Parameters:
replacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceFirst
Replace first occurrence of the pattern in the input string with the replacement string- Parameters:
pattern- The pattern to match againstreplacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceAllAndGet
Replace all occurrences of the pattern in the input string with the replacement string- Parameters:
replacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceAllAndGet
Replace all occurrences of the pattern in the input string with the replacement string- Parameters:
replacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceFirstAndGet
Replace first occurrence of the pattern in the input string with the replacement string- Parameters:
replacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
replaceFirstAndGet
Replace first occurrence of the pattern in the input string with the replacement string- Parameters:
replacement- The replacement string- Returns:
- The input string with all occurrences of the pattern replaced with the replacement string
-
get
Get's the input string as modified by the matcher- Returns:
- The input string
-
reset
Reset the input string to the original value- Returns:
- The matcher instance
-