Writing code
FUNCTION
@skmtc/lang-typescript 0.19.1escapeRegExpText
A pattern that matches exactly text: each syntax character is escaped (a.b → a\.b), and each line terminator becomes its escape. Only characters that may be escaped under the u and v flags are escaped, so the result is valid with any flags.
Signature
import { escapeRegExpText } from '@skmtc/lang-typescript'
escapeRegExpText(text: string): stringParameters
text, string required
Example
escapeRegExpText('a.b') // 'a\\.b'
escapeRegExpText('count()') // 'count\\(\\)'
escapeRegExpText('id') // 'id'Returns
string