Forum: Ruby Re: Small regexp question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Benjohn B. (Guest)
on 2006-03-12 13:27
(Received via mailing list)
Stefan M. said:


>
> You can use
>
> /myregexp/m
>
> but I'm not sure where this is documented.
>

Which is exactly what I was after, thanks.

The list of characters that you can slap on to the end are (cribbed from
the Nutshell):

i => case-insensitive
o => substitute only once.
x => ignores whitespace so that you can put comments in to a regex.
m => matches over multiple lines - newlines are treated as any other
character.

And you can use combinations too, if you fancy.

Cheers Stefan,
   Benjohn
This topic is locked and can not be replied to.