类 Patterns
- java.lang.Object
-
- net.dongliu.commons.regex.Patterns
-
public class Patterns extends java.lang.ObjectUtils method for pattern
-
-
构造器概要
构造器 构造器 说明 Patterns()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static java.util.List<java.lang.String>getAllMatched(java.util.regex.Pattern pattern, java.lang.String text)Match the text with pattern, get all matched group as strings.static java.util.List<java.lang.String>getAllMatched(java.util.regex.Pattern pattern, java.lang.String text, int groupIndex)Match the text with pattern, get all matched group as strings.static java.util.List<java.lang.String>getAllMatched(java.util.regex.Pattern pattern, java.lang.String text, java.lang.String groupName)Match the text with pattern, get all matched group as strings.static java.util.stream.Stream<java.lang.String>matched(java.util.regex.Pattern pattern, java.lang.String text)Match the text with pattern, wrap the match result as Stream.static java.util.stream.Stream<java.lang.String>matched(java.util.regex.Pattern pattern, java.lang.String text, int groupIndex)Match the text with pattern, wrap the match result as Stream.
-
-
-
方法详细资料
-
matched
public static java.util.stream.Stream<java.lang.String> matched(java.util.regex.Pattern pattern, java.lang.String text)Match the text with pattern, wrap the match result as Stream.- 参数:
pattern- the regex pattern to find matchertext- the target text- 返回:
- matched string stream
-
matched
public static java.util.stream.Stream<java.lang.String> matched(java.util.regex.Pattern pattern, java.lang.String text, int groupIndex)Match the text with pattern, wrap the match result as Stream.- 参数:
pattern- the regex pattern to find matchertext- the target textgroupIndex- the index of a capturing group in this matcher's pattern- 返回:
- matched string stream
-
getAllMatched
public static java.util.List<java.lang.String> getAllMatched(java.util.regex.Pattern pattern, java.lang.String text)Match the text with pattern, get all matched group as strings.- 参数:
pattern- the regex pattern to find matchertext- the target text- 返回:
- matched strings
-
getAllMatched
public static java.util.List<java.lang.String> getAllMatched(java.util.regex.Pattern pattern, java.lang.String text, int groupIndex)Match the text with pattern, get all matched group as strings.- 参数:
pattern- the regex pattern to find matchertext- the target textgroupIndex- the index of a capturing group in this matcher's pattern- 返回:
- matched strings
-
getAllMatched
public static java.util.List<java.lang.String> getAllMatched(java.util.regex.Pattern pattern, java.lang.String text, java.lang.String groupName)Match the text with pattern, get all matched group as strings.- 参数:
pattern- the regex pattern to find matchertext- the target textgroupName- the name of a named-capturing group in this matcher's pattern- 返回:
- matched strings
-
-