Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
<Badge(?:(?:\n|.)*?)is="secondary"(?:(?:\n|.)*?)(?=\/Badge)
/
g

Description

In this example we are searching for all <Badge> element/component in JSX that have the is="secondary" prop. This regex was tested with VS Code

Submitted by anonymous - 2 months ago