View Single Post
Old 06-23-2010, 11:49 AM   #16
Valloric
Created Sigil, FlightCrew
Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.Valloric ought to be getting tired of karma fortunes by now.
 
Valloric's Avatar
 
Posts: 1,982
Karma: 350515
Join Date: Feb 2008
Device: Kobo Clara HD
Quote:
Originally Posted by sherman View Post
Personally, for added safety (especially if your forget to check the minimal matching!!) I would use something like:

Find what: <p class="h1">([^<]+)</p>

The only difference from a users point of view is that you are guaranteed that the regex will stop at the first < it comes across.
That will fail to match p elements that have embedded spans in them (or <i>, <b> etc.). It would just silently ignore the whole element.

You should really use "<p class="h1">(.+)</p>" with minimal matching.
Valloric is offline   Reply With Quote