I want to break the border attribute from CSS into its component parts. ie:
.someClass{ border: 1px solid black; }
IN
border-width: 1px border-style: solid; border-color: black;
I split the border: and half a year before, so I just need to parse the attribute value section
Now in CSS you can have any combination of the three attributes above to
border: 1px solid; border: solid Gold; border: 1em; border: 1mm
All are legal, so I need to consider this.
What am i still
([0-9]+[a-zA-Z|%]+)* *([a-zA-Z]*) *( .*)
Which is great for the normal case, but it doesnβt work in the case of β1px Solid,β since Solid is placed in the 3rd capture group, not the 2nd. I am not a regular expression expert, so I can make very simple mistakes, but any help would be greatly appreciated. I work with C # (but mostly tested http://gskinner.com/RegExr/ , so any differences could be a problem)
source share