kiat has asked for the wisdom of the Perl Monks concerning the following question:
I need a regex to remove "bad" tags and keep the good ones from a string.
Here are some examples of what are considered good tags (assuming each of them is an input string):
I need to remove the ones below:[b]bold text[/b] [color=Red]Red text text[/color] [color=Red][b]Red bold text[/b][/color]
That is, without any text in between the tags.[b][/b] [color=Red][/color] [color=Red][b][/b][/color]
Is there an easy way to do that?
Thanks in advance :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex help
by tachyon (Chancellor) on Jul 31, 2004 at 12:17 UTC | |
by kiat (Vicar) on Jul 31, 2004 at 12:25 UTC | |
|
Re: Regex help
by Dietz (Curate) on Jul 31, 2004 at 12:27 UTC | |
by tachyon (Chancellor) on Jul 31, 2004 at 13:19 UTC | |
by ysth (Canon) on Aug 01, 2004 at 05:54 UTC | |
by tachyon (Chancellor) on Aug 01, 2004 at 08:31 UTC | |
by kiat (Vicar) on Jul 31, 2004 at 12:39 UTC | |
by Dietz (Curate) on Jul 31, 2004 at 14:35 UTC |