On 15 Oct 2007, at 1:58 PM, Greg V. Raven wrote:

OK, I'm stumped. I'm attempting to come up with a GREP pattern that will find empty HTML tags. In building up to the full pattern, I've found that this matches the start tag and the white space after it:

<([a-zA-Z]+) *.*?>\s*

The normal pattern for a closing tag seems to be:

</[a-zA-Z]+>

Given that I've captured the opening tag, it seems to me that the pattern for the closing tag in my overall pattern should be:

<([a-zA-Z]+) ?.*?>\s*</\1>

However, while this pattern finds some empty tags, if I have nested tags (empty or full), it finds the entire tag string, which is not correct.

Any thoughts on what I'm missing?

I am having trouble following your terminology at the end. Would you please post examples of text the pattern does and does not work with, so we could try it for ourselves?

        — F


--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to