public class RegExp extends Object
Modifier and Type | Field and Description |
---|---|
static String |
$1 |
static String |
$2 |
static String |
$3 |
static String |
$4 |
static String |
$5 |
static String |
$6 |
static String |
$7 |
static String |
$8 |
static String |
$9 |
String |
flags
Returns a string indicating the flags of the regular expression in question.
|
Boolean |
global
Returns a Boolean value indicating the state of the global flag (g) used with a regular expression.
|
Boolean |
ignoreCase
Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression.
|
double |
lastIndex |
static String |
lastMatch |
Boolean |
multiline
Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression.
|
static RegExp |
prototype |
String |
source
Returns a copy of the text of the regular expression pattern.
|
Boolean |
sticky
Returns a Boolean value indicating the state of the sticky flag (y) used with a regular
expression.
|
Boolean |
unicode
Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular
expression.
|
constructor
Modifier | Constructor and Description |
---|---|
protected |
RegExp() |
|
RegExp(String pattern) |
|
RegExp(String pattern,
String flags) |
Modifier and Type | Method and Description |
---|---|
static RegExp |
applyStatic(String pattern) |
static RegExp |
applyStatic(String pattern,
String flags) |
RegExp |
compile() |
RegExpExecArray |
exec(String string)
Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
|
String[] |
match(String string)
Matches a string with a regular expression, and returns an array containing the results of
that search.
|
String |
replace(String string,
String replaceValue)
Replaces text in a string, using a regular expression.
|
double |
search(String string) |
String[] |
split(String string)
Returns an Array object into which substrings of the result of converting string to a String
have been stored.
|
String[] |
split(String string,
double limit)
Returns an Array object into which substrings of the result of converting string to a String
have been stored.
|
Boolean |
test(String string)
Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
|
$applyStatic, $applyStatic, $delete, $delete, $get, $get, $set, $set, $super, assign, create, create, defineProperties, defineProperty, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, hasOwnProperty, hasOwnProperty, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, propertyIsEnumerable, propertyIsEnumerable, seal, toJSString, toLocaleString, toString, valueOf
public String source
public Boolean global
public Boolean ignoreCase
public Boolean multiline
public double lastIndex
public static RegExp prototype
public static String $1
public static String $2
public static String $3
public static String $4
public static String $5
public static String $6
public static String $7
public static String $8
public static String $9
public static String lastMatch
public String flags
public Boolean sticky
public Boolean unicode
public RegExp(String pattern)
protected RegExp()
public RegExpExecArray exec(String string)
string
- The String object or string literal on which to perform the search.public Boolean test(String string)
string
- String on which to perform the search.public RegExp compile()
public String[] match(String string)
string
- A string to search within.public String replace(String string, String replaceValue)
searchValue
- A String object or string literal that represents the regular expressionreplaceValue
- A String object or string literal containing the text to replace for every
successful match of rgExp in stringObj.public double search(String string)
public String[] split(String string, double limit)
string
- string value to splitlimit
- if not undefined, the output array is truncated so that it contains no more
than limit elements.public String[] split(String string)
string
- string value to splitlimit
- if not undefined, the output array is truncated so that it contains no more
than limit elements.