public interface RegexpMatcher extends NamedGroupMatchResult
| 限定符和类型 | 方法和说明 |
|---|---|
RegexpMatcher |
appendReplacement(StringBuffer b,
String replacement)
对匹配到的部分,进行文本替换
|
void |
appendTail(StringBuffer b)
把原始文本中 剩余部分添加的 StringBuffer中
|
boolean |
find()
Attempts to find the next subsequence of the input sequence that matches
the pattern.
|
boolean |
find(int start)
Resets this matcher and then attempts to find the next subsequence of
the input sequence that matches the pattern, starting at the specified
index.
|
boolean |
matches()
Attempts to match the entire region against the pattern.
|
RegexpMatcher |
reset()
Resets this matcher.
|
end, group, namedGroups, names, startend, end, group, group, groupCount, start, startboolean matches()
If the match succeeds then more information can be obtained via the start, end, and group methods.
RegexpMatcher reset()
Resetting a matcher discards all of its explicit state information and sets its append position to zero. The matcher's region is set to the default region, which is its entire character sequence. The anchoring and transparency of this matcher's region boundaries are unaffected.
boolean find()
This method starts at the beginning of this matcher's region, or, if a previous invocation of the method was successful and the matcher has not since been reset, at the first character not matched by the previous match.
If the match succeeds then more information can be obtained via the start, end, and group methods.
boolean find(int start)
If the match succeeds then more information can be obtained via the
start, end, and group methods, and subsequent
invocations of the find() method will start at the first
character not matched by this match.
start - the index to start searching for a matchIndexOutOfBoundsException - If start is less than zero or if start is greater than the
length of the input sequence.RegexpMatcher appendReplacement(StringBuffer b, String replacement)
b - 替换后存入的bufferreplacement - 替换物void appendTail(StringBuffer b)
b - Copyright © 2022. All rights reserved.