Struct RegExp

#[repr(transparent)]
pub struct RegExp { /* private fields */ }

Implementations

impl RegExp

fn exec(&self, text: &str) -> Option<Array<JsString>>

The exec() method executes a search for a match in a specified string. Returns a result array, or null.

MDN documentation

impl RegExp

fn ignore_case(&self) -> bool

The ignoreCase property indicates whether or not the "i" flag is used with the regular expression. ignoreCase is a read-only property of an individual regular expression instance.

MDN documentation

impl RegExp

fn set_last_index(&self, index: u32)

The lastIndex is a read/write integer property of regular expression instances that specifies the index at which to start the next match.

MDN documentation

impl RegExp

fn left_context() -> JsString

The non-standard leftContext property is a static and read-only property of regular expressions that contains the substring preceding the most recent match. `RegExp.$`` is an alias for this property.

MDN documentation

impl RegExp

fn n2() -> JsString

impl RegExp

fn n5() -> JsString

impl RegExp

fn n8() -> JsString

impl RegExp

fn new_regexp(pattern: &RegExp, flags: &str) -> RegExp

impl RegExp

fn sticky(&self) -> bool

The sticky property reflects whether or not the search is sticky (searches in strings only from the index indicated by the lastIndex property of this regular expression). sticky is a read-only property of an individual regular expression object.

MDN documentation

impl RegExp

fn unicode(&self) -> bool

The unicode property indicates whether or not the "u" flag is used with a regular expression. unicode is a read-only property of an individual regular expression instance.

MDN documentation

impl RegExp

fn flags(&self) -> JsString

The flags property returns a string consisting of the flags of the current regular expression object.

MDN documentation

impl RegExp

fn input() -> JsString

The non-standard input property is a static property of regular expressions that contains the string against which a regular expression is matched. RegExp.$_ is an alias for this property.

MDN documentation

impl RegExp

fn last_match() -> JsString

The non-standard lastMatch property is a static and read-only property of regular expressions that contains the last matched characters. RegExp.$& is an alias for this property.

MDN documentation

impl RegExp

fn multiline(&self) -> bool

The multiline property indicates whether or not the "m" flag is used with the regular expression. multiline is a read-only property of an individual regular expression instance.

MDN documentation

impl RegExp

fn n3() -> JsString

impl RegExp

fn n6() -> JsString

impl RegExp

fn n9() -> JsString

impl RegExp

fn right_context() -> JsString

The non-standard rightContext property is a static and read-only property of regular expressions that contains the substring following the most recent match. RegExp.$' is an alias for this property.

MDN documentation

impl RegExp

fn test(&self, text: &str) -> bool

The test() method executes a search for a match between a regular expression and a specified string. Returns true or false.

MDN documentation

impl RegExp

fn global(&self) -> bool

The global property indicates whether or not the "g" flag is used with the regular expression. global is a read-only property of an individual regular expression instance.

MDN documentation

impl RegExp

fn last_index(&self) -> u32

The lastIndex is a read/write integer property of regular expression instances that specifies the index at which to start the next match.

MDN documentation

impl RegExp

fn last_paren() -> JsString

The non-standard lastParen property is a static and read-only property of regular expressions that contains the last parenthesized substring match, if any. RegExp.$+ is an alias for this property.

MDN documentation

impl RegExp

fn n1() -> JsString

The non-standard $1, $2, $3, $4, $5, $6, $7, $8, $9 properties are static and read-only properties of regular expressions that contain parenthesized substring matches.

MDN documentation

impl RegExp

fn n4() -> JsString

impl RegExp

fn n7() -> JsString

impl RegExp

fn new(pattern: &str, flags: &str) -> RegExp

The RegExp constructor creates a regular expression object for matching text with a pattern.

MDN documentation

impl RegExp

fn source(&self) -> JsString

The source property returns a String containing the source text of the regexp object, and it doesn't contain the two forward slashes on both sides and any flags.

MDN documentation

impl RegExp

fn to_string(&self) -> JsString

The toString() method returns a string representing the regular expression.

MDN documentation

Trait Implementations

impl AsRef<JsValue> for RegExp

fn as_ref(&self) -> &JsValue

impl AsRef<Object> for RegExp

fn as_ref(&self) -> &Object

impl AsRef<RegExp> for RegExp

fn as_ref(&self) -> &RegExp

impl Clone for RegExp

fn clone(&self) -> Self

impl Debug for RegExp

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Deref for RegExp

type Target = Object;
fn deref(&self) -> &Object

impl Eq for RegExp

impl ErasableGeneric for RegExp

type Repr = JsValue;

impl From<JsValue> for RegExp

fn from(obj: JsValue) -> Self

impl FromWasmAbi for RegExp

type Abi = <JsValue as FromWasmAbi>::Abi;
unsafe fn from_abi(js: Self::Abi) -> Self

impl IntoJsGeneric for RegExp where RegExp: JsGeneric,

type JsCanon = RegExp;
fn to_js(self) -> RegExp

impl IntoWasmAbi for RegExp

type Abi = <JsValue as IntoWasmAbi>::Abi;
fn into_abi(self) -> Self::Abi

impl JsCast for RegExp

fn instanceof(val: &JsValue) -> bool
fn unchecked_from_js(val: JsValue) -> Self
fn unchecked_from_js_ref(val: &JsValue) -> &Self

impl LongRefFromWasmAbi for RegExp

type Abi = <JsValue as LongRefFromWasmAbi>::Abi;
type Anchor = RegExp;
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor

impl OptionFromWasmAbi for RegExp

fn is_none(abi: &Self::Abi) -> bool

impl OptionIntoWasmAbi for RegExp

fn none() -> Self::Abi

impl PartialEq for RegExp

fn eq(&self, other: &Self) -> bool

impl Promising for RegExp

type Resolution = RegExp;

impl RefFromWasmAbi for RegExp

type Abi = <JsValue as RefFromWasmAbi>::Abi;
type Anchor = ManuallyDrop<RegExp>;
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor

impl StructuralPartialEq for RegExp

impl UpcastFrom<RegExp> for RegExp

impl WasmDescribe for RegExp

fn describe()

Auto Trait Implementations

impl Freeze for RegExp

impl RefUnwindSafe for RegExp

impl Send for RegExp

impl Sync for RegExp

impl Unpin for RegExp

impl UnsafeUnpin for RegExp

impl UnwindSafe for RegExp

Blanket Implementations

impl<P, T> Receiver for RegExp where P: Deref<Target = T> + ?Sized, T: ?Sized,

impl<S, T> Upcast<T> for RegExp where T: UpcastFrom<S> + ?Sized, S: ?Sized,

impl<T> Any for RegExp where T: 'static + ?Sized,

impl<T> Borrow<T> for RegExp where T: ?Sized,

impl<T> BorrowMut<T> for RegExp where T: ?Sized,

impl<T> CloneToUninit for RegExp where T: Clone,

impl<T> From<T> for RegExp

impl<T> JsGeneric for RegExp where T: ErasableGeneric<Repr = JsValue> + UpcastFrom<T> + Upcast<JsValue> + JsCast + 'static,

impl<T> ReturnWasmAbi for RegExp where T: IntoWasmAbi,

impl<T> ToOwned for RegExp where T: Clone,

impl<T> TryFromJsValue for RegExp where T: JsCast,

impl<T> VectorFromWasmAbi for RegExp where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorIntoWasmAbi for RegExp where T: ErasableGeneric<Repr = JsValue> + WasmDescribe,

impl<T> VectorRefIntoWasmAbi for RegExp where &'a T: for<'a> Into<JsValue>,

impl<T, U> Into<U> for RegExp where U: From<T>,

impl<T, U> TryFrom<U> for RegExp where U: Into<T>,

impl<T, U> TryInto<U> for RegExp where U: TryFrom<T>,