|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.velocity.tools.RegexTool
public class RegexTool
Velocity Tool offering various Regex-based APIs to make it easy to manipulate regular expressions from Velocity.
| Nested Class Summary | |
|---|---|
class |
RegexTool.RegexResult
Result of a Regex search. |
| Constructor Summary | |
|---|---|
RegexTool()
|
|
| Method Summary | |
|---|---|
java.util.regex.Pattern |
compile(java.lang.String regex)
Compiles a regular expression into a java Pattern object. |
java.util.List<RegexTool.RegexResult> |
find(java.lang.String content,
java.lang.String regex)
|
java.lang.String |
quote(java.lang.String s)
Returns a literal pattern String for the specified String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RegexTool()
| Method Detail |
|---|
public java.util.List<RegexTool.RegexResult> find(java.lang.String content,
java.lang.String regex)
content - the content to parseregex - the regex to look for in the passed content
RegexTool.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 java.util.regex.Pattern compile(java.lang.String regex)
Pattern object.
regex - the textual representation of the regular expression
Pattern object corresponding to the regular expression, or null if the expression is
invalidpublic java.lang.String quote(java.lang.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 literalized
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||