note 19271 deleted from function.preg-replace by sniper

From: Date: Tue, 30 Sep 2003 12:30:01 +0000
Subject: note 19271 deleted from function.preg-replace by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57470@lists.php.net to get a copy of this message
Note Submitter: julio.g@chello.at ---- I have been working all day on this RegEx which I may only use once so I thought it would be nice at least to share it. What this thing do is it strips all <font...>...</font> tags from a document with the exception of those that contain face="symbol". You usually want to keep those as they signal a special character, frequently used in scientific papers for example. The thing goes like this: preg_replace("/(?(?!(<font[^>]+?Symbol[^>]+?>.+?<\/font>)) <font[^>]+?>(.+?)<\/font>)/is", "\\2", $fileCnt); I hope you will find it useful.

« previous php.notes (#57470) next »