@shhhplus/text-matcher
Version:
This tool can use specified rules to match text.
14 lines (13 loc) • 326 B
TypeScript
type MatchedNode = {
text: string;
payload: {
position: number;
ruleIndex: number;
matchIndex: number;
};
};
type Node = MatchedNode | string;
export default function createTextMatcher(rules: string | RegExp | Array<string | RegExp>): {
exec: (content: string) => Node[];
};
export {};