dynedain
Karma: 0
|
Modifying regex to exclude header tags - 2007/03/22 03:39
So one thing that bugs me on a site I'm working on is that glossarbot is good about not breaking up scripts, comments, links, etc, but does insert itself into things like headers
I tried modifying the regex:
| Code: | $htmlregex = '#(<a .*?</a *>|<script .*?</script *>|</?.*?>|<![ rnt]*(--([^-]|[rn]|-[^-])*--[ rnt]*)>«»)#i'
;
|
to be:
| Code: | $htmlregex = '#(<a .*?</a *>|<h.*?</h.*>|<script .*?</script *>|</?.*?>|<![ rnt]*(--([^-]|[rn]|-[^-])*--[ rnt]*)>
«»)#i';
|
Thinking that adding <h.*?</h.*> would allow me to escape all header tags (<h1><h2><h3> etc.) from being replaced. This doesn't seem to work even though <h.*?</h.*> as a regular expresion on its own will select the tags.
Can anyone help me out?
Post edited by: dynedain, at: 2007/03/22 03:40
|