java.util.regex.Matcher 类充当引擎,通过解释模式对字符序列执行匹配操作.
以下是 java.util.regex.Matcher class :
public final class Matcher extends Object implements MatchResult
Sr.No | 方法&说明 |
---|---|
1 | Matcher appendReplacement(StringBuffer sb,String replacement) 实现非终端追加和替换步骤. |
2 | StringBuffer appendTail(StringBuffer sb) 实现终端追加和替换步骤. |
3 | int end() 返回最后一个字符匹配后的偏移量. |
4 | int end(int group) 返回在给定组中捕获的子序列的最后一个字符之后的偏移量上一场比赛操作. |
5 | boolean find() 尝试查找与模式匹配的输入序列的下一个子序列. |
6 | boolean find(int start) 重置此匹配器,然后尝试查找与模式匹配的输入序列的下一个子序列,从指定的索引开始. |
7 | String group() 返回上一场比赛中给定组捕获的输入子序列操作. |
8 | String group(String name) 返回在上一个匹配操作期间由给定的命名捕获组捕获的输入子序列. |
9 | int groupCount() 返回此匹配器模式中的捕获组数. |
10 | boolean hasAnchoringBounds() 查询此匹配器的区域边界的锚定. |
11 | boolean hasTransparentBounds() 查询区域的透明度此匹配器的边界. |
12 | boolean hitEnd() 如果在此匹配器执行的最后一次匹配操作中搜索引擎命中了输入结束,则返回true. |
13 | boolean lookingAt() 尝试将从区域开头开始的输入序列与模式匹配. |
14 | boolean matches() 尝试将整个区域与模式匹配. |
15 | Pattern pattern() 返回此匹配器解释的模式. |
16 | static String quoteReplacement(String s) 返回指定String的文字替换字符串. |
17 | Matcher region(int start, int end) 设置此匹配器区域的限制. |
18 | int regionEnd() 报告此匹配区域的结束索引(不包括). |
19 | int regionStart() 报告此匹配区域的起始索引. |
20 | String replaceAll(String replacement) 用与给定替换字符串匹配的模式替换输入序列的每个子序列. |
21 | String replaceFirst(String replacement) 用与给定替换字符串匹配的模式替换输入序列的第一个子序列. |
22 | boolean requireEnd() 如果更多输入可以将正匹配更改为负数,则返回true. |
23 | Matcher reset() 重置此匹配器. |
24 | Matcher reset(CharSequence input) 使用新的输入序列重置此匹配器. |
25 | int start() 返回上一场比赛的开始索引. |
26 | int start(int group) 返回上一个匹配操作期间给定组捕获的子序列的起始索引. |
27 | MatchResult toMatchResult() 返回此匹配器的匹配状态为MatchResult. |
28 | String toStri ng() 返回此匹配器的字符串表示形式. |
29 | Matcher useAnchoringBounds(boolean b) 设置此匹配器的区域边界的锚定. |
30 | Matcher usePattern(Pattern newPattern) 更改模式此Matcher用于查找匹配. |
31 | Matcher useTransparentBounds(boolean b) 设置此匹配器的区域范围的透明度. |
此类继承了以下课程 :
Java.lang.Object