public class RegexUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Map<String,List<Integer>> |
extractMatches(String pattern,
String content)
Extracts matches of the given pattern in the content and returns them as a list.
|
static Map<String,List<Integer>> |
extractWordMatches(String pattern,
String content)
Extracts matches of the given pattern that are bounded by separation characters and returns them as a list.
|
protected static Map<String,List<Integer>> |
getMatches(String pattern,
String content,
int capture) |
public static Map<String,List<Integer>> extractMatches(String pattern, String content)
pattern
- the pattern for the substring to match. For example, [0-9]* matches 911 in Emergency number is 911.content
- the complete content to find matches in.public static Map<String,List<Integer>> extractWordMatches(String pattern, String content)
pattern
- the pattern for the substring to match. For example, [0-9]* matches 911 in Emergency number is 911.content
- the complete content to find matches in.Copyright © 2018 The Apache Software Foundation. All rights reserved.