V
Vince Forgetta
Hi all,
Is it possible to use embedded-code constructs in ruby regexp?
Perl Example:
<code>
"123"= ~ m{
\d+
(?{print "matched at [$'<$&>$']\n"})
(?!)
}x;
</code>
Output:
matched at [<123>]
matched at [<12>3]
matched at [<1>23]
matched at [1<23>]
matched at [1<2>3]
matched at [12<3>]
Thanks for the help
--
Vince Forgetta
Computational Biology
McGill University and Genome Quebec Innovation Centre
740 Dr. Penfield Avenue Room 7211
Montreal, Quebec Canada, H3A 1A4
Tel: 514-398-3311 00476
Email: (e-mail address removed)
Is it possible to use embedded-code constructs in ruby regexp?
Perl Example:
<code>
"123"= ~ m{
\d+
(?{print "matched at [$'<$&>$']\n"})
(?!)
}x;
</code>
Output:
matched at [<123>]
matched at [<12>3]
matched at [<1>23]
matched at [1<23>]
matched at [1<2>3]
matched at [12<3>]
Thanks for the help
--
Vince Forgetta
Computational Biology
McGill University and Genome Quebec Innovation Centre
740 Dr. Penfield Avenue Room 7211
Montreal, Quebec Canada, H3A 1A4
Tel: 514-398-3311 00476
Email: (e-mail address removed)