Re: regex help
| From: | Jason Wong | Date: | Fri, 14 Jan 2005 02:13:04 +0000 |
| Subject: | Re: regex help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-206351@lists.php.net to get a copy of this message | ||
On Friday 14 January 2005 05:06, Jason Morehouse wrote:
> Simple enough, in theory... I need to match (count) all of the bold tags
> in a string, including ones with embedded styles (or whatever else can
> go in there). <b> and <b style="color:red">. My attempts keep matching
> <br> as well.
Quick-n-dirty:
preg_match_all('/(<b>|<b\s+.*>)/iU', $doo, $match);
Feel free to extend to check for closing tags :)
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts