See this : Which characters are valid in CSS class names/selectors?
A value will have a digit after the dot. Luckily, valid CSS class names cannot start with a digit :)
Your regexp has to match a dot first, then a letter or - or _
! if you look for whitespace before the dot, a value like .5 will match ...
Try this one : (\.([a-zA-Z_-]{1}[\w-_]+))
Edit :
See this too : Regex to match a CSS class name
-?[_a-zA-Z]+[_a-zA-Z0-9-]*
Relevant quote :
Basically, a name must begin with an underscore (_), a hyphen (-), or a letter(a–z), followed by any number of hyphens, underscores, letters, or numbers. There is a catch: if the first character is a hyphen, the second character must be a letter or underscore, and the name must be at least 2 characters long.