JS_ExecuteRegExp 编辑
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 RegExp object. |
chars | const char16_t * | A pointer to the string contains a input string. |
length | size_t | The length of bytes or chars , in characters. |
indexp | size_t * | In/Out parameter. A pointer to the lastIndex for the execution, and received the updated lastIndex . |
test | bool | Pass true to avoid creating match result array and store boolean value to rval . |
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_ExecuteRegExpNoStatics
function
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论