Skip to main content

Regex

import { escapeRegExp, matchAll, replaceAllRegex } from '@rtorcato/js-common/regex'

Exports

NameSummary
escapeRegExpEscapes special regex characters in a string so it can be used in a RegExp.
matchAllReturns all matches of a regex pattern in a string.
replaceAllRegexReplaces all matches of a regex pattern in a string with a replacement.
splitByRegexSplits a string by a regex pattern.
testRegexTests if a string matches a given regex pattern.