From: David Alan Black Date: 2002-07-27T21:10:57+09:00 Subject: Re: regex: move minus sign to front for negative numbers w trailing " -" Hello -- On Sat, 27 Jul 2002, [iso-8859-1] "Pe�a, Botp" wrote: > puts (line.gsub ( /(\b)((\d+)|(\d+\.\d+))(-)/, > '>>\5\1\2<<')) I don't know why I bother trying to hammer out answers to questions like this when it's still daylight in Paris.... :-) but anyway, I just wanted to make one observation, for possible future reference. Namely: there's no point capturing a \b match and backreferencing it, because it's just a zero-width assertion. It doesn't actually match or consume a character in the string; it's just a constraint on the upcoming attempted match. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav