I do not know why you think it does nothing:
$ cat foo.pl #!/usr/bin/perl -w use strict; use warnings; my $text = '<font color="blue"><i><b> <br>Some text</font>, <br>an a' +; $text =~ s~<font color=("|')?((\w|\s)+)("|')?>(.*?)<\/font>~\[color=$2 +\]$5\[/color\]~ig; print $text . "\n"; $ ./foo.pl [color=blue]<i><b> <br>Some text[/color], <br>an a $
That's not to say the regex couldn't be improved/simplified, but it certainly seems to have an effect as it stands.
In reply to Re: Regex not working
by hippo
in thread Regex not working
by Beaker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |