public class JSRegExp extends JSObject
Modifier and Type | Class and Description |
---|---|
class |
JSRegExp.ExecResult
A special JSArray returned by the result of JSRegExp.exec()
See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec
|
JSObject.jsexport, JSObject.Property<T>
JSPropertyAttributeDontDelete, JSPropertyAttributeDontEnum, JSPropertyAttributeNone, JSPropertyAttributeReadOnly
Constructor and Description |
---|
JSRegExp(JSContext ctx,
java.lang.String pattern)
Creates a new JavaScript regular expression
|
JSRegExp(JSContext ctx,
java.lang.String pattern,
java.lang.String flags)
Creates a new JavaScript regular expression
|
Modifier and Type | Method and Description |
---|---|
JSRegExp.ExecResult |
exec(java.lang.String str)
JavaScript RegExp.prototype.exec(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/exec
|
java.lang.Boolean |
global()
Indicates if the "g" flag was used for a global match
|
java.lang.Boolean |
ignoreCase()
Indicates if the "i" flag was used to ignore case
|
java.lang.Integer |
lastIndex()
JavaScript RegExp.prototype.lastIndex
The index at which to start the next match
|
java.lang.Boolean |
multiline()
Indicates if the "m" flag was used to search in strings across multiple lines
|
java.lang.String |
source()
Return the text of the pattern
|
java.lang.Boolean |
test(java.lang.String str)
JavaScript, RegExp.prototype.test(), see:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test
|
__nullFunc, deleteProperty, getThis, hashCode, hasProperty, isConstructor, isFunction, property, property, property, propertyAtIndex, propertyAtIndex, propertyNames, prototype, prototype
equals, getContext, isArray, isBoolean, isDate, isEqual, isFloat32Array, isFloat64Array, isInstanceOfConstructor, isInt16Array, isInt32Array, isInt8Array, isNull, isNumber, isObject, isStrictEqual, isString, isTypedArray, isUint16Array, isUint32Array, isUint8Array, isUint8ClampedArray, isUndefined, toBoolean, toFunction, toJSArray, toJSON, toNumber, toObject, toString, valueHash, valueRef
public JSRegExp(JSContext ctx, java.lang.String pattern, java.lang.String flags)
ctx
- The context in which to create the regular expressionpattern
- The REGEXP patternflags
- The REGEXP flagspublic JSRegExp(JSContext ctx, java.lang.String pattern)
ctx
- The context in which to create the regular expressionpattern
- The REGEXP patternpublic JSRegExp.ExecResult exec(java.lang.String str)
str
- The string to matchpublic java.lang.Integer lastIndex()
public java.lang.Boolean ignoreCase()
public java.lang.Boolean global()
public java.lang.Boolean multiline()
public java.lang.String source()
public java.lang.Boolean test(java.lang.String str)
str
- The string against which to match the regular expression