EasyRegex Logo
EasyRegex
Nuevo

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

Javascript

Expresión Regular

^(<br>)+
Copiar
¿Tienes Comentarios?

Explicación

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

Ejemplo de Uso

const regex = /^(<br>)+;
const str = '<br><br>Hello, <br>World';
const matches = str.match(regex);
console.log(matches);
Copiar
Prueba la expresión

Expresiones Regulares Similares