Please help. I'm at my wits end as both Google and Bing are trolling me by returning results for converting tabs into spaces, but I want to convert spaces into tabs.
My regex-fu in this regard is weak at the moment.
The moment I post this, I find the Vim solution. Although I would still like the appropriate regex that works with one use on an entire file, which I can use via sed, the Vim solution is as follows:
:set ts=2
:set noet
:%retab!
Peter Scheler
JS enthusiast
/ {4}/gmfor 4 spaces.You can use
$text =~ s/ {4}/\t/gmfor replacing.