public class RegexTool extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
RegexTool.RegexResult
Result of a Regex search.
|
| Constructor and Description |
|---|
RegexTool() |
public List<RegexTool.RegexResult> find(String content, String regex)
content - the content to parseregex - the regex to look for in the passed contentRegexTool.RegexResult objects
containing the matched position and matched content for all capturing groups, the first group
representing the whole . The first object is represents the entire patternpublic Pattern compile(String regex)
Pattern object.regex - the textual representation of the regular expressionPattern object corresponding to the regular expression, or null if the expression is
invalidpublic String quote(String s)
String for the specified String.
This method produces a String that can be used to create a Pattern that would match the
string s as if it were a literal pattern.
s - The string to be literalizedCopyright © 2004–2014 XWiki. All rights reserved.