escapeRegExp
文字列 str
の正規表現メタ文字をエスケープし、エスケープ後の文字列を返します。
Added in v0.0.2
Usage
ts
import { escapeRegExp } from 'parsnip-kit'
escapeRegExp('hello world')
// 'hello world'
escapeRegExp('${name}')
// '\\$\\{name\\}'
API
Arguments
Arg | Type | Optional | Default | Description |
---|---|---|---|---|
str | string | false | undefined | エスケープする文字列 |
Returns
Type |
---|
string |