quoteRegExp()
Turn any string into a regular expression that matches the exact string without worrying about encoding the metacharacters yourself.
This function is valid in v2.0.0 to v2.24.3. This function has been downloaded 66 times.false
false
, it will cause just the escaped version of str
to be returned. If true
, it will be as if the empty string was passed in. A string represents the flags to be set in the returned regular expression.flagsOrMakeRegExp
is true
a regular expression without flags will be returned. If flagsOrMakeRegExp
is a non-empty string, a regular expression with the specified characters representing the corresponding flags will be returned. In all other cases just the escaped string that can be used as a regular expression will be returned.This function is directly required by the following functions:
around()
dice()
replace()
trimLeft()
trimRight()