public class RegExp
extends com.google.gwt.core.client.JavaScriptObject
Modifier and Type | Class and Description |
---|---|
static class |
RegExp.RegexException
Thrown to indicate a regular expression related exception
|
static class |
RegExp.RegexResult
The RegExpResult wraps the result of the search performed by the
exec(java.lang.String)
method |
Modifier | Constructor and Description |
---|---|
protected |
RegExp()
Create a new RegExp object
|
Modifier and Type | Method and Description |
---|---|
RegExp.RegexResult |
exec(String exp)
Performs a search for the regular expression on the specified
exp |
int |
getLastIndex()
Returns the index position at which the next search starts.
|
static RegExp |
getRegExp(String pattern,
String flags)
Returns a RegExp instance for the specified pattern and flags.
|
String |
getSource()
Returns the
pattern of the regular expression |
boolean |
isGlobal()
Checks if this RegExp object performs a global match.
|
boolean |
isIgnoreCase()
Checks if this RegExp object performs a match without case sensitivity
|
boolean |
isMultiline()
Checks if this RegExp object performs multiline matching.
|
void |
setLastIndex(int lastIndex)
Sets the index position at which to start the next search.
|
boolean |
test(String exp)
Tests for the match of the regular expression in the specified
exp . |
public static final RegExp getRegExp(String pattern, String flags) throws RegExp.RegexException
The flags can include the following:
pattern
- the pattern of the regular expressionflags
- the modifiers of the expressionRegExp.RegexException
- if any error occurs, such as invalid flagspublic final boolean isGlobal()
true
if the global property is set, false
otherwisepublic final boolean isIgnoreCase()
true
if the ignoreCase property is set, false
otherwisepublic final boolean isMultiline()
true
if the multiline property is set, false
otherwisepublic final int getLastIndex()
setLastIndex(int)
public final void setLastIndex(int lastIndex)
exec(java.lang.String)
and test(java.lang.String)
methods.lastIndex
- the new index positionpublic final String getSource()
pattern
of the regular expressionpattern
of the regular expressionpublic final boolean test(String exp)
exp
.true
if there is a match, false
otherwisepublic final RegExp.RegexResult exec(String exp) throws RegExp.RegexException
exp
exp
- the string to searchRegExp.RegexException
- if there is no matchCopyright © 2009-2013. All Rights Reserved.