I can't figure this out:
22.584\r\n\t\t\tl-6.579-22
I want to match the "\r\n\t\t\t" and replace with a single space " ". Problem is the number of "\t", "\r", and "\n" fluctuates, as do the surrounding characters.
Help!
I can't figure this out:
22.584\r\n\t\t\tl-6.579-22
I want to match the "\r\n\t\t\t" and replace with a single space " ". Problem is the number of "\t", "\r", and "\n" fluctuates, as do the surrounding characters.
Help!
s/\s+/ /g
s/(?:\\[rnt])+/ /g
\s matches more than just \t, \r or \n. It matches (in most cases) these: [ \t\n\x0B\f\r], but that may be fine with you of course.\\r or the like).In PHP:
preg_replace("/(?:\\\[trn])+/", " ", $str);