JS_NewRegExpObject

Create a new RegExp object.

Syntax

JSObject * JS_NewRegExpObject(JSContext *cx, JSObject *obj, char *regexp, size_t length, uintN flags);

JSObject * JS_NewUCRegExpObject(JSContext *cx, JSObject *obj, jschar *regexp, size_t length, uintN flags);

JSObject * JS_NewRegExpObjectNoStatics(JSContext *cx, char *regexp, size_t length, uintN flags);

JSObject * JS_NewUCRegExpObjectNoStatics(JSContext *cx, jschar *regexp, size_t length, uintN flags);
Name Type Description
cx JSContext *

The context in which to create the new object. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext.

obj
JSObject *
A global object.
regexp char * or jschar * The regular expression.
length size_t The length of regexp, in characters.
flags uintN Regular expression flags.

Description

If a global object is provided when creating a new RegExp instance, the flags from the built-in RegExp constructor properties ignoreCase, global, multiline, and sticky are OR'd in with the provided flags parameter. The NoStatics variants do not require a global object because they do not OR in any RegExp constructor properties.

MXR ID Search for JS_NewRegExpObject
MXR ID Search for JS_NewUCRegExpObject

MXR ID Search for JS_NewRegExpObjectNoStatics
MXR ID Search for JS_NewUCRegExpObjectNoStatics

Document Tags and Contributors

Contributors to this page: cdleary, Jorend
Last updated by: cdleary,