Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2017-04-11 11:34
Flavor·PCRE (Legacy)

/
(?!.*?\/)(?P<image>.*?)(?:\.(?:jpg|png))
/
g
Open regex in editor

Description

This regex will be getting the name of the image

source: data/products/cocacola/logo_new_version.jpg match: logo_new_version

It will be returned logo_new_version on image index

Submitted by strubloid