[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Regular expression mismatch ?

Kujawa, Greg

4/7/2005 1:13:00 PM

Good point. Anyone who has worked with regexes in the various languages can
attest to subtle (but far-reaching) differences between them. I recall the
first time I picked up the "Mastering Regular Expressions" book. A veritable
Bible for the beasties...

-----Original Message-----
From: David A. Black [mailto:dblack@wobblini.net]
Sent: Thursday, April 07, 2005 9:09 AM
To: ruby-talk@ruby-lang.org
Subject: Re: Regular expression mismatch ?


Hi --

On Thu, 7 Apr 2005, Han Holl wrote:

> On Apr 7, 2005 12:34 PM, David A. Black
>> The /m suffix means that \n is included in . (dot).
>>
> Yes, looked it up in the Pickaxe, and indeed that's what it says.
>
> This is from man perlre:
> m Treat string as multiple lines. That is, change "^" and "$"
> from matching the start or end of the string to matching then
> start or end of any line anywhere within the string.
>
> This should go on the page I've seen somewhere with gotchas. Perl RE
> is quite widespread, and when ruby deviates from it it's easy to trip
> up.

Not if you use Ruby more and more :-)


David

--
David A. Black
dblack@wobblini.net


1 Answer

dblack

4/7/2005 1:47:00 PM

0