Hi people
Given a PHP string
How can I use eregi to find out if the string contains any tag that is not <p> or </p>
any help with formatting this pattern will be useful
I am new to regular expressions
thanks
small help with regular expressions
Moderator: General Moderators
hmm... untested:
Code: Select all
</?[^p][^>]*>Technically
Should answer the specific question you asked without any regex at all.
Are you really asking a different question?
Code: Select all
if ($text != strip_tags($text, '<p>')) { /* must have contained non <p> tags */ }Are you really asking a different question?
- R4000
- Forum Contributor
- Posts: 168
- Joined: Wed Mar 08, 2006 12:50 pm
- Location: Cambridge, United Kingdom
if you need a regexp tester, i find http://www.rexv.org/ works brillientyl