[Ruby] regex question

Laurel Fan laurel.fan at gmail.com
Mon Feb 12 16:06:03 PST 2007


On 2/12/07, shaners becker <veganstraightedge at gmail.com> wrote:
> i'm in textmate, i've got some xml that i want to simplify. i should
> be able to do just that with some find and replace, right? so here's
> a shortened sample of what i have, in case that matters.
[snip]
>
> so... i tried both:
>
> /<recommendations>[^<]*<\/recommendations>/
> /<recommendations>.*?<\/recommendations >/
>
> neither of them found any results.

I'm not familar with textmate, but do you need to add an option to
match multiple lines?  Maybe the m option at the end, eg:

/<recommendations>.*?<\/recommendations >/m

-- 
Laurel Fan
http://blog.gorgorg.org


More information about the Ruby mailing list