@textlint/regexp-string-matcher
Version:
Regexp-like string matcher.
14 lines (13 loc) • 474 B
TypeScript
export interface matchPatternResult {
match: string;
captures: string[];
startIndex: number;
endIndex: number;
}
export declare const createRegExp: (patternString: string, defaultFlag?: string) => RegExp;
/**
* Match regExpLikeStrings and return matchPatternResults
* @param text target text
* @param regExpLikeStrings an array of pattern string
*/
export declare const matchPatterns: (text: string, regExpLikeStrings: string[]) => matchPatternResult[];