EasyRegex Logo
EasyRegex
Nuovo

Match Specific Image File Names in JavaScript

javascript

Espressione Regolare

^/(1|2|image|scam)\.jpg$
Copia

Spiegazione

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

Esempio di Utilizzo

const regex = /^/(1|2|image|scam)\.jpg$/;
Copia
Prova l'espressione

Espressioni Regolari Simili