EasyRegex Logo
EasyRegex
Neu

Detect <br> tags at the beginning of a string in JavaScript

Javascript

Regulärer Ausdruck

^(<br>)+
Kopieren
Haben Sie Feedback?

Erklärung

This regex pattern matches one or more occurrences of the '<br>' tag at the beginning of a string. '^' asserts the position at the start of the string. '<br>' matches the literal '<br>' tag. '+' matches one or more occurrences of the preceding element. The use of parentheses and the '+' quantifier ensures that it captures and matches multiple '<br>' tags at the beginning of the string.

Javascript

Beispielverwendung

const regex = /^(<br>)+;
const str = '<br><br>Hello, <br>World';
const matches = str.match(regex);
console.log(matches);
Kopieren
Testen Sie den Ausdruck

Ähnliche Reguläre Ausdrücke