note 29534 deleted from function.ereg-replace by tomsommer
| From: | tomsommer@php.net | Date: | Sat, 10 Jan 2004 20:58:43 +0000 |
| Subject: | note 29534 deleted from function.ereg-replace by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63291@lists.php.net to get a copy of this message | ||
Note Submitter: schwarzie@sympatico.ca
----
The above example is good if you want to remove comment tags in a file, but what if you wanted to
remove any text between two tags?
For instance,
<script language="JavaScript">
<!--
{Text goes here}
//-->
</script>
Using "<!--([^-]*([^-]|-([^-]|-[^>])))*//-->" removes all content between the two
tages: <!-- and //-->, but I can't seem to get rid of the parent tags.
<script([^-]*([^-]|-([^-]|-[^>])))*script>
THIS ABOVE DOES NOT WORK