TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
regex
Hey all,
Does anybody know a regular expression (in vi, preferably) I can use to
take an arbitary number of strings of 2-4 characters and replace them with
the same string, surrounded with single quotes and a comma afterwards.
(Basically, I want to take a file full of acronyms and create a
comma-delimited list with tick marks around every acronym).
For example,
FOO would become 'FOO',
FBAR would become 'FBAR',
I've tried a bunch of stuff, but nothing I have tired works. It either
does the whole line as one string, like
s/.*/\'&\',/g
or breaks up strings like,
s/..../\'&\',/g
The one above is so close I can taste it, but I can't figure it
out....Anybody?
Luke