regexp.ts

Declarations
#

2 declarations

view source

escape_regexp
#

regexp.ts view source

(str: string): string

Escapes a string for literal matching in a RegExp.

str

type string

returns

string

reset_regexp
#

regexp.ts view source

<T extends RegExp>(regexp: T): T

Reset a RegExp's lastIndex to 0 for global and sticky patterns. Ensures consistent behavior by clearing state that affects subsequent matches.

regexp

type T

returns

T