Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript regex for tab followed by a space

In Javascript what would be the regex for a tab followed by a space (EXACTLY THAT).

I know it's something like:

var c = dataString.replace(/\t\s/g,'<br />');

But this is finding tabs or spaces globally, not a tab followed by a space as an exact match.

Thanks ahead of time!

like image 292
DeltaTango Avatar asked Jun 18 '12 16:06

DeltaTango


1 Answers

It would be /\t /

\s also matches other whitespace characters, so you need a literal space character.

like image 111
Alnitak Avatar answered Sep 30 '22 19:09

Alnitak