Dynamic module xregexp

Index

Interfaces

Functions

Functions

XRegExp(pattern: string, flags?: string): RegExp

Parameters

  • pattern: string
  • flags?: string optional

Returns

RegExp

XRegExp(pattern: RegExp): RegExp

Parameters

  • pattern: RegExp

Returns

RegExp

version: string

addToken(regex: RegExp, handler: (matchArr: RegExpExecArray, scope: string) => string, options?: TokenOpts)

Parameters

  • regex: RegExp
  • handler: (matchArr: RegExpExecArray, scope: string) => string
  • options?: TokenOpts optional

build(pattern: string, subs: Array<string>, flags?: string): RegExp

Parameters

  • pattern: string
  • subs: Array<string>
  • flags?: string optional

Returns

RegExp

cache(pattern: string, flags?: string): RegExp

Parameters

  • pattern: string
  • flags?: string optional

Returns

RegExp

escape(str: string): string

Parameters

  • str: string

Returns

string

exec(str: string, regex: RegExp, pos?: number, sticky?: boolean): RegExpExecArray

Parameters

  • str: string
  • regex: RegExp
  • pos?: number optional
  • sticky?: boolean optional

Returns

RegExpExecArray

forEach(str: string, regex: RegExp, callback: (matchArr: RegExpExecArray, index: number, input: string, regexp: RegExp) => void, context?: Object): any

Parameters

  • str: string
  • regex: RegExp
  • callback: (matchArr: RegExpExecArray, index: number, input: string, regexp: RegExp) => void
  • context?: Object optional

Returns

any

globalize(regex: RegExp): RegExp

Parameters

  • regex: RegExp

Returns

RegExp

install(options: string)

Parameters

  • options: string

install(options: Object)

Parameters

  • options: Object

isInstalled(feature: string): boolean

Parameters

  • feature: string

Returns

boolean

isRegExp(value: any): boolean

Parameters

  • value: any

Returns

boolean

matchChain(str: string, chain: Array<RegExp>): Array<string>

Parameters

  • str: string
  • chain: Array<RegExp>

Returns

Array<string>

matchRecursive(str: string, left: string, right: string, flags?: string, options?: Object): Array<string>

Parameters

  • str: string
  • left: string
  • right: string
  • flags?: string optional
  • options?: Object optional

Returns

Array<string>

replace(str: string, search: string, replacement: string, scope?: string): string

Parameters

  • str: string
  • search: string
  • replacement: string
  • scope?: string optional

Returns

string

replace(str: string, search: string, replacement: Function, scope?: string): string

Parameters

  • str: string
  • search: string
  • replacement: Function
  • scope?: string optional

Returns

string

replace(str: string, search: RegExp, replacement: string, scope?: string): string

Parameters

  • str: string
  • search: RegExp
  • replacement: string
  • scope?: string optional

Returns

string

replace(str: string, search: RegExp, replacement: Function, scope?: string): string

Parameters

  • str: string
  • search: RegExp
  • replacement: Function
  • scope?: string optional

Returns

string

split(str: string, separator: string, limit?: number): Array<string>

Parameters

  • str: string
  • separator: string
  • limit?: number optional

Returns

Array<string>

split(str: string, separator: RegExp, limit?: number): Array<string>

Parameters

  • str: string
  • separator: RegExp
  • limit?: number optional

Returns

Array<string>

test(str: string, regex: RegExp, pos?: number, sticky?: boolean): boolean

Parameters

  • str: string
  • regex: RegExp
  • pos?: number optional
  • sticky?: boolean optional

Returns

boolean

uninstall(options: Object)

Parameters

  • options: Object

uninstall(options: string)

Parameters

  • options: string

union(patterns: Array<string>, flags?: string): RegExp

Parameters

  • patterns: Array<string>
  • flags?: string optional

Returns

RegExp