From: Mattia Peronio Date: 2003-02-23T12:35:08+09:00 Subject: String.to_re ?? Messaggio in formato MIME composto da piy parti. ------=_NextPart_000_00B2_01C2DAF5.D871BB10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I will explain you my problem, with a short example code: ------------------------------------------------ a =3D "Good this kind of work!" b =3D "this kind" puts a[Regexp.new("G.*#{b}.*rk!")] >> Good this kind of = work!" a =3D "Good this+kind of work!" b =3D "this+kind" puts a[Regexp.new("G.*#{b}.*rk!")] >> nil ----------------------------------------------- I woud like to know if you can implement a method string.to_re which = converts a string to a regular expression, i.e.: Good this+kind of work >>>> Good this[+]kind of work Thank you very much for your wonderful Ruby! Mattia Peronio ------=_NextPart_000_00B2_01C2DAF5.D871BB10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I will explain you my problem, with a = short example=20 code:
 
------------------------------------------------
a =3D "Good this kind of work!"
b = =3D "this=20 kind"
puts=20 a[Regexp.new("G.*#{b}.*rk!")]       &n= bsp;      =20 >> Good this kind of work!"
a =3D "Good this+kind of work!"
b = =3D=20 "this+kind"
puts=20 a[Regexp.new("G.*#{b}.*rk!")]       &n= bsp;    =20 >> nil
-----------------------------------------------
 
I woud like to know if you can = implement a method=20 string.to_re which converts a string to a regular expression, = i.e.:
 
Good this+kind of=20 work        = >>>>   Good=20 this[+]kind of work
 
 
Thank you very much for your wonderful=20 Ruby!
Mattia Peronio
 
 
------=_NextPart_000_00B2_01C2DAF5.D871BB10--