T
tsuraan
I have a string "foo\nbar=3Dblah", which I'd like to entirely replace
with "baz=3Dblah". Supposedly, the regular expression constructed with
/.../i will match newlines, but it doesn't seem to work:
Is there any way to do this? Does the /.../i really do what I think
it should do?
with "baz=3Dblah". Supposedly, the regular expression constructed with
/.../i will match newlines, but it doesn't seem to work:
=3D> "foo\nbar=3Dblah"str =3D "foo\nbar=3Dblah" =3D> "foo\nbar=3Dblah"
str.sub(/.*bar/i, 'baz') =3D> "foo\nbaz=3Dblah"
str.sub(/\A.*bar/i, 'baz')
Is there any way to do this? Does the /.../i really do what I think
it should do?