Regular Expressions 101

Community Patterns

Match all Tailwind CSS classes prefixed with dark:


Regular Expression
PCRE2 (PHP >=7.3)



A simple expression for removing Tailwind CSS classes that are prefixed with dark: from your HTML. Can be easily changed to remove any other classes with a specific prefix. I made this so I could easily remove dark mode from Tailwind CSS components I find online.

Submitted by hexrw - 7 months ago