Created
July 1, 2022 13:43
-
-
Save m-ostadi/489408713b60561a2f3e92acb1c0c191 to your computer and use it in GitHub Desktop.
regex for adding tailwind prefix to existing tailwind classes
This file contains 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
in your editor (i used phpstorm ctrl+shift+f for find and replace in all files of a specific folder): | |
find : (?<=class=["'][^"']*)([0-9a-zA-Z_-]+\s*)(?=[^"']*["']) | |
replace : tw-$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when dealing with
[]
propsuse this
(?<=className=["'][^"']*)([\[\]#0-9a-zA-Z_-]+\s*)(?=[^"']*["'])
adding props like
/90
(?<=className=["'][^"']*)([\[\]\/#0-9a-zA-Z_-]+\s*)(?=[^"']*["'])