--nextPart1151914.iA3RVV388T
Content-Type: text/plain;
  charsetso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

irb(main):001:0> a  Jasmine"
"Jasmine"
irb(main):002:0> phrase  jas"
"jas"
irb(main):003:0> a.sub(/#{phrase}/i, '**')
"**mine"
irb(main):004:0>



Am Dienstag 22 November 2005 13:29 schrieb Vamsee Kanakala:
> Hi all,
>
> I'm playing with patterns:
>
> irb(main):001:0> name  Jasmine"
> "Jasmine"
> irb(main):002:0> phrase  ja"
> "ja"
> irb(main):003:0> name.sub(/ja/i, '**')
> "**smine"
> irb(main):004:0> name.sub(/phrase/i, '**')
> "Jasmine"
>
> So, how do I tell sub that it should use the local variable phrase
> instead of the string 'phrase' ?
>
> TIA,
> Vamsee.

--nextPart1151914.iA3RVV388T
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBDgxBPMdQeL6eBxhIRAkPIAJ9Gkt95Sn4Mr6IfJhA1x9yYNYzJzwCdEC48
/4hGvSnSXnCt2weZviu0jhYߨv
-----END PGP SIGNATURE-----

--nextPart1151914.iA3RVV388T--