Execute a new RegExp object to given input string.
Syntax
bool
JS_ExecuteRegExp(JSContext *cx, JS::HandleObject obj, JS::HandleObject reobj,
                 char16_t *chars, size_t length, size_t *indexp, bool test,
                 JS::MutableHandleValue rval);
bool
JS_ExecuteRegExpNoStatics(JSContext *cx, JS::HandleObject reobj,
                          char16_t *chars, size_t length,
                          size_t *indexp, bool test,
                          JS::MutableHandleValue rval);
| Name | Type | Description | 
|---|---|---|
| cx | JSContext * | The context. Requires request. In a  | 
| obj | JS::HandleObject | A pointer to a global object. | 
| reobj | JS::HandleObject | A pointer to a RegExpobject. | 
| chars | const char16_t * | A pointer to the string contains a input string. | 
| length | size_t | The length of bytesorchars, in characters. | 
| indexp | size_t * | In/Out parameter. A pointer to the lastIndexfor the execution, and received the updatedlastIndex. | 
| test | bool | Pass trueto avoid creating match result array and store boolean value torval. | 
| rval | JS::MutableHandleValue | Out parameter. Receives the result match result array or boolean value. | 
Description
JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics execute the RegExp object, reobj, to the specified input string, chars, from *indexp index.
If test is false, JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics store the match result array to *rval if matches, otherwise stores null to *rval. If test is true, JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics store the boolean value true to *rval if matches, otherwise stores null to *rval.
JS_ExecuteRegExp updates the built-in RegExp object's properties.
If successful, JS_ExecuteRegExp and JS_NewRegExpObjectNoStatics returns true and stores the result to *rval, otherwise returns false and the value of *rval is undefined
See Also
- MXR ID Search for JS_ExecuteRegExp
- MXR ID Search for JS_ExecuteRegExpNoStatics
- RegExp
- bug 571355 - added JS_ExecuteRegExpNoStaticsfunction