From what I've read in the specs for CSS2 selectors. The following are all the legal special characters that can be used:
* > : + ~ - ( ) [ ] = " | . # ,
Which means that the following regex should do me well on those cold winter nights:
([a-zA-Z0-9 *>:+~-()[]="|.#,].+?)
A few tests show that it does return eactly what I was looking for. So I shall stick with it till I come across some css data that makes it totally freak out beacause I over looked some possible css formating scenario, as I'm prone to do with my hastily written regex's.
[addendum] Don't forget to strip out the multiline C type /* comments */ before applying your rules to CSS : P
(hopefully this post was easier to read than the last one : P)
* > : + ~ - ( ) [ ] = " | . # ,
Which means that the following regex should do me well on those cold winter nights:
([a-zA-Z0-9 *>:+~-()[]="|.#,].+?)
A few tests show that it does return eactly what I was looking for. So I shall stick with it till I come across some css data that makes it totally freak out beacause I over looked some possible css formating scenario, as I'm prone to do with my hastily written regex's.
[addendum] Don't forget to strip out the multiline C type /* comments */ before applying your rules to CSS : P
(hopefully this post was easier to read than the last one : P)


