Created
January 26, 2014 20:41
-
-
Save ryelle/8639210 to your computer and use it in GitHub Desktop.
Regex for finding margins & padding in CSS. Ended up not terribly useful, but interesting?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (padding|margin)(-top|-left|-right|-bottom)?:(\s*(\d*(.\d*)?(em|rem|px|)|auto)){1,4}\s*(!important)?; |
Fantastic! Thank you so much! Worked perfectly
Thanks for this, but it could be updated to match negative values like:
margin: -9px;
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here I am 7 years later finding this useful for refactoring a project with lots of these inline styles. I'm using the regex in VS Code search.