I have a simple text field which I need to validate with a regex.
The text field is supposed to contain inline-styles in the "proper" format xxx: xxx;
Ex: font-size: 15px; background: #33333; -webkit-transition: background-color 500ms ease-out 1s;
Any regex gurus out there help me out here. I'll eventually find the solution on my own but that may take awhile.
Languages would be javascript for client side validation then moving onto php for the server side validation.
Thanks a bunch guys... I came up with this -- /([a-z-]+: [0-9a-z#(). -]+;$)/g --. I would answer myself but I'm unsure if its the best solution.
Gonna accept the most detailed answer below from @nu11p01n73R as I stole the $ sign from his explanation that made the above work right.
Now is there an issue with what I came up with? Know I'm not technically supposed to ask but I think its easier to read for me to read, anyways. I love SO.