CCH
02-02-2010, 09:21 PM
I'm using a script that searches a string for specific text and uses the match() function to determine how many times that string appears within another string. Specifically I want to find out how many lines of text have the inline CSS "color:#00FF00;"
Using the line str.match(/#00FF00/gi); seems to work fine in IE, but will not return any results in Firefox. Is there an error in my RegExp, or does Firefox just have an issue with searching for hex color codes? If I replace the script to search for a word, like "green" instead of the color code, it works on both browsers, but the default CSS color for "green" is not the color I want to use for the displayed text.
Using the line str.match(/#00FF00/gi); seems to work fine in IE, but will not return any results in Firefox. Is there an error in my RegExp, or does Firefox just have an issue with searching for hex color codes? If I replace the script to search for a word, like "green" instead of the color code, it works on both browsers, but the default CSS color for "green" is not the color I want to use for the displayed text.