RegEx patterns are defined here. The patterns are identical to the ones defined in the Java java.util.regex.Pattern class. This provides a powerful, full-featured regular expression language.
Pattern capturing groups are numbered in the order they occur in the pattern, starting at 1.
Group 0 corresponds to the match for the entire pattern.
Capturing group references may be used in pattern replacement strings.
The syntax is '$n' (e.g. "aaa$1bbb").
'\' may be used to escape literal '$' and '\' characters.
Capturing Groups
Resources
The following websites provide regular expressions for many common patterns.
Examples
String RegEx.extract( String input, String pattern, int groupIndex )
input - The input string
pattern - The pattern to match to
groupIndex - The index of the group to extract
String RegEx.extract( String input, String pattern )
input - The input string
pattern - The pattern to match to
boolean RegEx.find( String input, String pattern )
input - The input string
pattern - The pattern to match to
boolean RegEx.matches( String input, String pattern )
input - The input string
pattern - The pattern to match to
boolean RegEx.replaceFirst( String input, String pattern, String replacement )
input - The input string
pattern - The pattern to match to
replacement - The replacement string
boolean RegEx.replaceAll( String input, String pattern, String replacement )
input - The input string
pattern - The pattern to match to
replacement - The replacement string
String RegEx.splitAt( String input, String pattern, int index )
input - The input string
pattern - The pattern to match to
index - The index of the split substring to return