View Single Post
Old 06-18-2015, 03:20 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
Code:
<div><p( [^>]*)?>
The problem is that this search goes wrong if I have something like:

Code:
<div><p class="pp">
The ? after the parenthesis is being interpreted as a normal character because there isn't a "*" matching expression immediately in front of it (the parenthesis intervenes). I assume you are trying to make the * not greedy. That is not required because the NOT ^ character set is already not greedy, stopping at the first ">".

If for some reason you really want to make the "[^>]*" not greedy then you must put the question immediately after the star, as in "[^>]*?"
chaley is offline   Reply With Quote