Snippet format update
To match the starter (for the migration)
This commit is contained in:
@ -1,4 +1,7 @@
|
||||
### escapeRegExp
|
||||
---
|
||||
title: escapeRegExp
|
||||
tags: string,regexp,intermediate
|
||||
---
|
||||
|
||||
Escapes a string to use in a regular expression.
|
||||
|
||||
@ -10,4 +13,4 @@ const escapeRegExp = str => str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
|
||||
```js
|
||||
escapeRegExp('(test)'); // \\(test\\)
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user