From: Austin Ziegler Date: 2006-04-12T03:06:23+09:00 Subject: Re: regex flags On 4/11/06, Tom Allison wrote:> Generically, how do you impliment the various flags?>> I figured out: s/ / /g --> gsub> and s/ / / -> sub Ruby doesn't support as many regex flags as Perl does. This is good. However, %r{..}i will do case insensitive; %r{...}x will do extended.There is a %r{...}m flag, but it doesn't *quite* do the same as somepeople expect, I think (it just changes the meaning of . to be able tomatch \n, etc. I think). There is no %r{...}g flag, IIRC. If you simply want a match, you use "string" =~ /regex/options; if youwant to scan something, you might use #grep. -austin--Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca