Awesome q2a theme

How to remove a css rule in the regular season?

0 like 0 dislike
26 views
Good time of day. Please tell me how a regular expression to remove nameless rule in css ?
Example:
{ color: red; }


I wrote a regular season
/((\|\\s{2,3})\\{)(.+?)\\}/is
It works, but deletes and such rules
a { color: red }
by | 26 views

1 Answer

0 like 0 dislike
https://regex101.com/r/OFX59Z/7

Here you can change the number of transfers after defining the selector, duplicating [\\w)] with the addition of the \\s within the group "lookbehind" (?<!). А в [\\w)] добавлять ещё какие-нибудь символы для предотвращения удаления.
by

Related questions

110,608 questions
257,187 answers
0 comments
40,796 users