This includes everything that is NOT - or ; :
[^-;]
You want to cut spaces, you can add a space:
[^-; ]
To remove all space characters you can add:
[^-;\s]
Here is a good link for REGEX .
If you are only trying to capture a phrase starting with the word "style", then there is no reason for the match.
Then find something inside quotes that are not quotes:
style=\"[^\"]+\"
I added escape characters because I didn’t understand which application or language you included in this code.
source share