Ralph Shnelvar wrote in post #980369:
> Fearless, your solution seems to work ... but I am clueless as to how
> and why it works!

I'm FAR from a regex wizard, but it's worth noting:
   [abc] means match any occurrence of a or b or c
   [^abc] means match any character that is NOT a or b or c
ergo
  [^<] means match anything that is NOT an open bracket
  [^<]+ means match one or more things are are not open brackets

so
  /<(h\d)>[^<]+Placeholder2.*?<\/\1>/

matches an open < followed by an h followed by a digit followed by a 
close >, then any number of characters as long as they are NOT < 
followed by "Placeholder2" ... etc

Of course, this will break as soon as someone adds attributes to the 
<h1> tag, such as <h1 class="navbar">, which is why we all like 
Nokogiri.  I'm sorry your ISP doesn't agree!  :)

-- 
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.

Reply via email to