EasyRegex Logo
EasyRegex
Nuevo

Match Specific Image File Names in JavaScript

javascript

Expresión Regular

^/(1|2|image|scam)\.jpg$
Copiar
¿Tienes Comentarios?

Explicación

This regex pattern will match specific image file names like '1.jpg', '2.jpg', 'image.jpg', or 'scam.jpg'. The '^' asserts the start of the string, '/' matches the forward slash, '(1|2|image|scam)' matches any of the specified image names, '\.' matches the dot before 'jpg', 'jpg' matches the file extension, and '$' asserts the end of the string.

javascript

Ejemplo de Uso

const regex = /^/(1|2|image|scam)\.jpg$/;
Copiar
Prueba la expresión

Expresiones Regulares Similares