memos/web/src/labs/marked/matcher.ts
boojack 0f8ce3dd16
refactor: return jsx element instead of string in marked (#910)
* refactor: return jsx element instead of string in marked

* chore: update
2023-01-07 00:13:49 +08:00

4 lines
130 B
TypeScript

export const matcher = (rawStr: string, regexp: RegExp) => {
const matchResult = rawStr.match(regexp);
return matchResult;
};