A global search for whitespace characters: lettext ="Is this all there is?"; letpattern =/\s/g; Try it Yourself » Description The \s metacharacter matches whitespace character. Whitespace characters can be: A space character A tab character ...
The \D metacharacter matches non-digit characters. Browser Support /\D/is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: ChromeEdgeFirefoxSafariOperaIE YesYesYesYesYesYes Syntax new RegExp("\\D") or simply: ...
JavaScript RegExp - p.p JavaScript RegExp - ^.{2}$ JavaScript RegExp - (.*) JavaScript RegExp - p(hp)* Literal Characters JavaScript RegExp - Alphanumeric JavaScript RegExp - \0 JavaScript RegExp - \t JavaScript RegExp - \n JavaScript Reg...
Brackets are used to find a range of characters:ExpressionDescription [abc] Find any character between the brackets [^abc] Find any character NOT between the brackets [0-9] Find any digit between the brackets [^0-9] Find any digit NOT between the brackets (x|y) Find any of the ...
wp-includes/formatting.php functionwp_spaces_regexp(){static$spaces='';if(empty($spaces) ) {/** * Filters the regexp for common whitespace characters. * * This string is substituted for the \s sequence as needed in regular * expressions. For websites not written in English, different ch...
Allow only two special characters in Regex Allow postive and negative decimal numbers only using Javascript allow the user to select the destination folder for file download? allowing a textbox to only enter date alternative to session variable An application error occurred on the server. The curren...
Allow only two special characters in Regex Allow postive and negative decimal numbers only using Javascript allow the user to select the destination folder for file download? allowing a textbox to only enter date alternative to session variable An application error occurred on the server. The curren...
Example A global search for non-word characters: let text = "Give 100%!"; let pattern = /\W/g; Try it Yourself » Description The \W metacharacter matches non-word characters: A word character is a character a-z, A-Z, 0-9, including _ (underscore)....
Search for a carriage return character in a string: lettext ="Visit W3Schools.\rLearn Javascript."; letpattern =/\r/; Try it Yourself » Description The \r metacharacter matches carriage return characters. Browser Support /\r/is an ECMAScript1 (JavaScript 1997) feature. ...
lettext ="Visit W3Schools.\0Learn Javascript."; letpattern =/\0/; Try it Yourself » Description The \0 metacharacter matches NUL characters. Browser Support /\0/is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: ...