[Ruby] regex question

Laurel Fan laurel.fan at gmail.com
Mon Feb 12 16:15:25 PST 2007


On 2/12/07, shaners becker <veganstraightedge at gmail.com> wrote:
> /<recommendations>[^<]*<\/recommendations>/

This one won't work because it won't match any recommendations tag
that has other tags nested in it (eg.
<recommendations><book></book></recommendations>)

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

This one won't work because there's a space in the closing tag, but I
assumed that was just a transcription error.  (without the space it
WorksForMe in ruby, no textmate here)

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


More information about the Ruby mailing list