Consider the string xyz<h1>x P0 y</h1><h1>x Q1 y</h1><h1>1 Placeholder2 2</h1>abc
and the pattern <(h\d)>.*?Placeholder2.*?<\/\1> the pattern matches <h1>x P0 y</h1><h1>x Q1 y</h1><h1>1 Placeholder2 2</h1> I want it to match <h1>1 Placeholder2 2</h1> How can I do this? That is, I want to find the nearest <h1> ... </h1> surrounding Placeholder2. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

