java.lang.Object | ||
↳ | com.google.gwt.core.client.JavaScriptObject | |
↳ | com.google.gwt.regexp.shared.RegExp |
GWT wrapper for the Javascript RegExp class extended with the Javascript String class's replace and split methods, which can take a RegExp parameter.
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a regular expression object from a pattern with no flags.
| |||||||||||
Creates a regular expression object from a pattern with no flags.
| |||||||||||
Applies the regular expression to the given string.
| |||||||||||
Returns whether the regular expression captures all occurences of the
pattern.
| |||||||||||
Returns whether the regular expression ignores case.
| |||||||||||
Returns the zero-based position at which to start the next match.
| |||||||||||
Returns whether '$' and '^' match line returns ('\n' and '\r') in addition
to the beginning or end of the string.
| |||||||||||
Returns the pattern string of the regular expression.
| |||||||||||
Returns the input string with the part(s) matching the regular expression
replaced with the replacement string.
| |||||||||||
Sets the zero-based position at which to start the next match.
| |||||||||||
Splits the input string around matches of the regular expression.
| |||||||||||
Splits the input string around matches of the regular expression.
| |||||||||||
Determines if the regular expression matches the given string.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.core.client.JavaScriptObject
| |||||||||||
From class
java.lang.Object
|
Creates a regular expression object from a pattern with no flags.
pattern | the Javascript regular expression pattern to compile |
---|
RuntimeException | if the pattern is invalid |
---|
Creates a regular expression object from a pattern with no flags.
pattern | the Javascript regular expression pattern to compile |
---|---|
flags | the flags string, containing at most one occurence of 'g' (getGlobal() ), 'i' (getIgnoreCase()
), or 'm' (getMultiline() ). |
RuntimeException | if the pattern or the flags are invalid |
---|
Applies the regular expression to the given string. This call affects the
value returned by getLastIndex()
if the global flag is set.
input | the string to apply the regular expression to |
---|
null
Returns whether the regular expression captures all occurences of the pattern.
Returns whether the regular expression ignores case.
Returns the zero-based position at which to start the next match. The
return value is not defined if the global flag is not set. After a call
to exec(String)
or test(String)
, this method returns
the next position following the most recent match.
Returns whether '$' and '^' match line returns ('\n' and '\r') in addition to the beginning or end of the string.
Returns the input string with the part(s) matching the regular expression replaced with the replacement string. If the global flag is set, replaces all matches of the regular expression. Otherwise, replaces the first match of the regular expression. As per Javascript semantics, backslashes in the replacement string get no special treatment, but the replacement string can use the following special patterns:
input | the string in which the regular expression is to be searched. |
---|---|
replacement | the replacement string. |
RuntimeException | if replacement is invalid
|
---|
Sets the zero-based position at which to start the next match.
Splits the input string around matches of the regular expression. If the regular expression is completely empty, splits the input string into its constituent characters. If the regular expression is not empty but matches an empty string, the results are not well defined.
input | the string to be split. |
---|
Splits the input string around matches of the regular expression. If the regular expression is completely empty, splits the input string into its constituent characters. If the regular expression is not empty but matches an empty string, the results are not well defined.
input | the string to be split. |
---|---|
limit | the the maximum number of strings to split off and return, ignoring the rest of the input string. If negative, there is no limit. |
Determines if the regular expression matches the given string. This call
affects the value returned by getLastIndex()
if the global flag is
not set. Equivalent to: exec(input) != null
input | the string to apply the regular expression to |
---|