Search for a tab character in a string:
var patt1 = /\t/;
The marked text below shows where the expression gets a match:
Try it yourself »
Definition and Usage
The \t metacharacter is used to find a tab character.
\t returns the position where the tab character was found. If no match is found, it returns -1.
The \t metacharacter is supported in all major browsers.
Thank You For Helping Us!
Your message has been sent to W3Schools.