JavaScript RegExp Methods
Method | Description |
---|---|
compile() | Deprecated in version 1.5. Compiles a regular expression |
escape() | Returns a string where characters that belongs to the regular expression syntax are escaped |
exec() | Tests for a match in a string. Returns the first match |
test() | Tests for a match in a string. Returns true or false |
toString() | Returns the string value of the regular expression |
Browser Support
/regexp/
is an ECMAScript1 (JavaScript 1997) feature.
It is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |