UNPKG

@tiptap/core

Version:

headless rich text editor

5 lines (4 loc) 163 B
// source: https://stackoverflow.com/a/6969486 export function escapeForRegEx(string: string): string { return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&') }