CosmosRP Posted March 13, 2010 Share Posted March 13, 2010 I currently have a regex: (\074color\s*=\042[0-9A-Za-z]+?\042\s*\076.*<\057color>) .. that matches " <color="hexcode/colorname">anything[wildcard]</color> " However, I want to change this so that it matches: " lt;color="HEXCODE/COLORNAME">ANYTHING[WILDCARD]</color> I imagine its just a simple matter of editing the original regex, but i'm really inexperienced when it comes to this stuff. Can someone help? =O Link to comment https://forums.phpfreaks.com/topic/195119-i-need-a-bit-of-regex-help/ Share on other sites More sharing options...
cags Posted March 13, 2010 Share Posted March 13, 2010 The only difference I can spot is the capitalization, is that what you were getting at? If that is the case then you should only need to add a modifier. I suggest you post the exact line of code you are using rather than just the regex as I'm guessing your using ereg, which is now deprecated. Link to comment https://forums.phpfreaks.com/topic/195119-i-need-a-bit-of-regex-help/#findComment-1025628 Share on other sites More sharing options...
sasa Posted March 17, 2010 Share Posted March 17, 2010 (<color\s*="[0-9A-Za-z]+?"\s*>.*</color>) or use htmlspecialchars_decode() function before regex Link to comment https://forums.phpfreaks.com/topic/195119-i-need-a-bit-of-regex-help/#findComment-1027767 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.