Skip to content

Instantly share code, notes, and snippets.

View angelzarza's full-sized avatar
:octocat:
Coffee loading... ☕

Ángel Zarza angelzarza

:octocat:
Coffee loading... ☕
View GitHub Profile
@Potherca
Potherca / README.md
Last active May 29, 2024 10:57
The search for a Regex to match BEM CSS class-names

The search for a Regex to match BEM CSS class-names

TL;DR

Use this regular expression to match BEM class-names:

^\.[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$