java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.base.StarMatcher |
A string matcher accepting wildcard-expressions *
(any number of chars) and ?
(any one char). An initial star is implied to allow matching anywhere in the expression. E.g.:
"blah*foo"
will match "xxxblahyyyfoo"
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
class | StarMatcher.Result | String match result provided by the find method. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
StarMatcher(String searchPattern, boolean caseInsensitive, boolean useEscapes)
Create a matcher.
| |||||||||||
StarMatcher(String searchPattern)
Create a case-insensitive matcher that supports escape sequences.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Collection<String> |
collect(Collection<String> values)
Collect all
matches . | ||||||||||
StarMatcher.Result |
find(String buffer, int fromIndex)
Search for a match in the provided buffer.
| ||||||||||
int |
getCharSearchLength()
Retrieve the minimum number of characters contained in substrings matched by this matcher.
| ||||||||||
boolean |
matches(String value)
Attempt to find the search string inside the provided buffer.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pnfsoftware.jeb.util.base.IStringMatcher
|
Create a matcher.
searchPattern | search string; may contain * (any number of chars) or ?
(any single char); a leading star is implied by the search routines; * and
? cannot be used as the search string header, i.e. they will be silently
discarded if found before any actual character sequence; to use * and
? as actual characters to be searched, escape them with \; other usual
escapes (\r, \n, \t, \', \") can be used; unknown escape sequences will simply be
treated as normal character sequences \x |
---|---|
caseInsensitive | true to conduct case-insensitive searches |
useEscapes | true to allow the escape of special characters question mark, star, as well as CR, LF, TAB, single-quote, double-quote, and backslash, with a backslash character |
Create a case-insensitive matcher that supports escape sequences.
searchPattern | search string (see StarMatcher(String, boolean, boolean) )
|
---|
Search for a match in the provided buffer.
buffer | text to be searched |
---|---|
fromIndex | start index in the buffer |
Retrieve the minimum number of characters contained in substrings matched by this matcher.
Attempt to find the search string inside the provided buffer. This method returns true if the search string is found.
value | buffer to be matched |
---|