public final class ReMatcher extends Object implements MatchResult
| 构造器和说明 |
|---|
ReMatcher(ReTree tree,
CharSequence input)
Initialize Matcher by the specified regular expression tree and input.
|
ReMatcher(String... res)
Construction for convenience.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
end() |
int |
end(int groupIndex) |
boolean |
find()
Execute once regular expression finding operation from the previous offset.
|
boolean |
find(int offset)
Execute once regular expression finding operation from the specefic offset.
|
String |
group() |
String |
group(int groupIndex) |
CharSequence |
group(String groupName)
Fetch captured group by its name.
|
int |
groupCount() |
String |
groupName(int groupIndex)
Fetch the specified capture-group's name by its index.
|
boolean |
matches()
Execute regular expression matching operation
|
boolean |
matches(CharSequence input)
Reset the current matcher's input, then execute matches.
|
String |
re()
Fetch the matched regular expression as string.
|
ReMatcher |
reset(CharSequence input)
Reset this matcher by another input, could be used for reusing
|
int |
start() |
int |
start(int groupIndex) |
public ReMatcher(String... res)
res - All regular expressionpublic ReMatcher(ReTree tree, CharSequence input)
tree - ReTree represents multiple regular expression.input - The default input, which could be changed by {reset(CharSequence)}public ReMatcher reset(CharSequence input)
input - New inputpublic boolean matches()
public boolean matches(CharSequence input)
input - New inputpublic boolean find()
public boolean find(int offset)
offset - The starting positionpublic int start()
start 在接口中 MatchResultpublic int start(int groupIndex)
start 在接口中 MatchResultpublic int end()
end 在接口中 MatchResultpublic int end(int groupIndex)
end 在接口中 MatchResultpublic String group()
group 在接口中 MatchResultpublic String group(int groupIndex)
group 在接口中 MatchResultpublic int groupCount()
groupCount 在接口中 MatchResultpublic CharSequence group(String groupName)
groupName - Group's namepublic String re()
public String groupName(int groupIndex)
groupIndex - group's indexCopyright © 2019. All rights reserved.