string - Convert spaces to tabs in RegEx -
How do you say the following in regex:
foreach line look at the beginning string Convert 3 groups of each group to one tab Once a character is found in addition to a location, then stop it
This is what I've done so far:
/ ^ + / \ t / g
However, it converts everywhere to 1 tab
Any help will be appreciated .
with Pearl:
perl -pe '1 while s / \ G {3} / \ For example, with the following input, between the three loops, between three loops, three six places, three in the middle six, space
Output (tab replaced by \ t
) is
$ perl -pe '1 while s / \ g {3} / \ t / gc' input |
Comments
Post a Comment