Regular Expressions 101

Community Patterns

1...34567...476

Adds custom prefix to tailwind classes

1

Regular Expression
PCRE (PHP <7.3)

/
(?<=\G(?!^)|\@apply) ([^\s\;]*|[\p{P}]*)
/
gm

Description

Or any other particular case where given any line that starts with the pattern "@apply" (or any other line heading) and it substitutes any word (list of characters without spaces), with or without puntuation in them, and it adds a custom prefix to all the words in that line but the line heading.

Submitted by @drakopablo.dev - 9 months ago