From: Ralph Mason Date: 2002-04-11T08:25:21+09:00 Subject: Am I going mad? Works in IRB not in a file! This is a multi-part message in MIME format. ------=_NextPart_000_12E8_01C1E14B.AA6F9240 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This must be something I am doing wrong. In a file the output from this x =3D "\"CommaTest, After\", More" x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}") p x is "~, More" Run from IRB the output is irb(main):047:0> x =3D "\"CommaTest, After\", More" "\"CommaTest, After\", More" irb(main):048:0> x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}") "CommaTest~ After, More" irb(main):049:0> p x "CommaTest~ After, More" nil What is going on here?=20 Thanks for any help Ralph ------=_NextPart_000_12E8_01C1E14B.AA6F9240 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
This must be something I am doing = wrong.  In a=20 file the output from this
 
x =3D "\"CommaTest, After\",=20 More"
x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}")
p x
 
is
 
"~, More"
 
 
Run from IRB the output is
 
irb(main):047:0> x =3D "\"CommaTest, = After\",=20 More"
"\"CommaTest, After\", More"
irb(main):048:0>=20 x.gsub!(/\"(.*),(.*)\"/,"#{$1}~#{$2}")
"CommaTest~ After,=20 More"
irb(main):049:0> p x
"CommaTest~ After, = More"
nil
 
What is going on here?
 
Thanks for any help
Ralph
 

 
 
------=_NextPart_000_12E8_01C1E14B.AA6F9240--