ctrl+k
Enter a search term above to see results...
Enter a search term above to see results...
The Regular Expression utilities provide functions for working with regular expressions and string patterns in JavaScript. These functions help in creating, escaping, and applying regular expressions efficiently.
Escapes special characters in a string for use in a regular expression.
This function escapes all special regex characters
[ ] { } ( ) / \ ^ $ . | ? * +
which is helpful when inserting a dynamic string into a regex like a user search query.
Name | Type | Description |
---|---|---|
string | string | The string to escape |
A new string with all regular expression special characters escaped.
Escapes HTML special characters in a string.
Name | Type | Description |
---|---|---|
string | string | The string to escape |
A new string with HTML special characters escaped.