Javascript examples for RegExp:Metacharacter
The \t metacharacter matches a tab character and returns the position where the tab character was found. If no match is found, it returns -1.
The following code shows how to Search for a tab character in a string:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w. ja v a 2 s .c o m var patt = new RegExp("Hello World", "g"); var res = patt.toString(); document.getElementById("demo").innerHTML = res; } </script> </body> </html>