Please support RegExLib Sponsors
.NET Engine Client-side Engine Silverlight Tester
Source Regular Expression <\*?font # Match start of Font Tag (?(?=[^>]+color.*>) #IF/THEN lookahead color in tag (.*?color\s*?[=|:]\s*?) # IF found THEN move ahead ('+\#*?[\w\s]*'+ # CAPTURE ColorName/Hex |"+\#*?[\w\s]*"+ # single or double |\#*\w*\b) # or no quotes .*?> # & move to end of tag |.*?> # ELSE move to end of Tag ) # Close the If/Then lookahead # Use Multiline and IgnoreCase # Replace the matches from RE with MatchEvaluator below: # if m.Groups(1).Value<>"" then # Return "<font color=" & m.Groups(1).Value & ">" # else # Return "<font>" # end if
Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials