View Single Post
Old 07-17-2012, 12:44 PM   #3
ElMiko
Addict
ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.ElMiko actually enjoys Vogon poetry.
 
ElMiko's Avatar
 
Posts: 320
Karma: 56788
Join Date: Jun 2011
Device: Kindle
Quote:
Originally Posted by DiapDealer View Post
I'm not sure I understand the question. You haven't made your look-behind or look-ahead assertions optional, so both should already be required. Your expression should already be logically correct. But I'm not certain whether you're looking for instances where the bullet IS or ISN'T enclosed with p tags.

ISN'T
Code:
(?<!<p class="calibre1">)•(?!</p>)
I'm looking for isn't, but, as I suspected, the above expression doesn't search for instances where the bullet is NOT enclosed with p tags. It searches for instances where the bullet is not preceded by an opening p tag, and for instances where the bullet is not preceded by closing p tag. Which is to say, it will exclude the following instance that I don't want it to exclude:

Code:
<p class="calibre1">•A</p>

<p class="calibre1">A•</p>
EDIT: As I understand the way the above search works (and this seems to be confirmed by my subsequent testing), is that It first looks for all instances with a bullet preceded by the p tag and excludes them. Then it looks for all instances of the bullet followed by the p tag, and excludes them. Then it returns any results that weren't excluded by the preceding TWO searches. It is not a single search to exclude an enclosed bullet.

Last edited by ElMiko; 07-17-2012 at 01:02 PM.
ElMiko is offline   Reply With Quote