From: "Ara.T.Howard" Date: 2004-05-14T22:23:52+09:00 Subject: Re: Regexp Error? On Fri, 14 May 2004, Kristof Bastiaensen wrote: > On Fri, 14 May 2004 20:18:55 +0900, ts wrote: > > >>>>>> "R" == Robert Klemme writes: > > > > R> irb(main):023:0> "123-456".gsub(/.*/, 'X') > > R> => "XX" > > > > * first match : "123-456" > > * now it's at end > > * second match with the empty string > > > > I would say the empty string is included with "123-456", > so it shouldn't give another match: > > echo "123-456" | sed 's/.*/X/g' > X > > Kristof yes but ~ > echo "123-456" | perl -npe 's/.*$/X/g' XX and sed regexps are not the same as perl/ruby right? -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | URL :: http://www.ngdc.noaa.gov/stp/ | TRY :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done ===============================================================================