regex question....

perryh at perryh at
Sun Dec 5 02:01:34 UTC 2010

Joshua Gimer <jgimer at> wrote:

> On Sat, Dec 4, 2010 at 5:26 PM, Gary Kline <kline at> wrote:
> > I have tried :1,$/s/[0-9]][0-9][0-9]/foo/g
> Why not just %s/[0-9]*/foo/g

Too broad -- it will match the null string.  (* means "zero or more
instances of" whatever preceded it.)

Best RE I know for integers is


(or replace the 1 with a 0 if the strings in question might have
leading zeros).

More information about the freebsd-questions mailing list