How do I convert the following string
"str 1<tab>str 2<tab>str 3<tab>str 4..........<tab>str n<tab and some whitespace>"
to
"*str 1*<tab>*str 2*<tab>*str 3*<tab>*str 4*..........<tab>*str n*<tab and some whitespace>"
where str could be “Stack – overflow” or “Super : User” i.e words containing some space and special characters.
I know we can use split and work this out. Is there a way using only =~ s///.. ?
Thanks in advance !
Trinity
To deal with the ‘special characters’, simply add it to the list of unwanted items: