How to remove a css rule in the regular season?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
19 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 | 19 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