@dashevo/re2-wasm
Version:
Google's RE2 library distributed as a WASM module
63 lines (62 loc) • 1.95 kB
TypeScript
export interface RE2ExecArray extends Array<string | undefined> {
index: number;
input: string;
groups?: {
[key: string]: string;
};
}
export interface RE2MatchArray extends Array<string | undefined> {
index?: number;
input?: string;
groups?: {
[key: string]: string;
};
}
declare class RE2 {
private _global;
private _ignoreCase;
private _multiline;
private _dotAll;
private _unicode;
private _sticky;
lastIndex: number;
private pattern;
private wrapper;
private groupNames;
private namedGroups;
constructor(pattern: string | RegExp | RE2, flags?: string);
get source(): string;
get internalSource(): string;
get flags(): string;
get global(): boolean;
get ignoreCase(): boolean;
get multiline(): boolean;
get dotAll(): boolean;
get unicode(): boolean;
get sticky(): boolean;
toString(): string;
private getMaybeStickyIndex;
private isMatchSuccessful;
private maybeUpdateLastIndex;
private getNamedGroups;
exec(input: string): RE2ExecArray | null;
test(input: string): boolean;
compile(): this;
[Symbol.match](input: string): RE2MatchArray | null;
match(input: string): RE2MatchArray | null;
/**
* Outputs the replacement for the matched part of the string
* @param input
* @param match
* @param replacer
*/
private replaceMatch;
[Symbol.replace](input: string, replacer: string | ((substring: string, ...args: any[]) => string)): string;
replace(input: string, replacer: string | ((substring: string, ...args: any[]) => string)): string;
[Symbol.search](input: string): number;
search(input: string): number;
[Symbol.split](input: string, limit?: number): (string | undefined)[];
split(input: string, limit?: number): (string | undefined)[];
}
export default function InitializeRe2(): Promise<typeof RE2>;
export {};