golfromeo Posted November 21, 2009 Share Posted November 21, 2009 In my system, when a person sends a private message, I want them to be able to display colors, like so: (WITHOUT exclamation point) [!color=red]Hello![/color] Is there a way using Regex to recognize the color tag, and then separate that into "red" and "Hello!"? Because once I can do that, I have the code to change the red color and make it into a hex code for CSS. Thanks for any help in advance. Quote Link to comment https://forums.phpfreaks.com/topic/182443-help-with-parsing-colors/ Share on other sites More sharing options...
Alex Posted November 21, 2009 Share Posted November 21, 2009 Do you only want the color to be a word like 'red', 'green', etc? If so you can use use \+)\](.+)\[\/color\] Quote Link to comment https://forums.phpfreaks.com/topic/182443-help-with-parsing-colors/#findComment-962836 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.