Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2016-02-18 22:37
Flavor·PCRE (Legacy)

/
(\"(?P<filename>[\p{L}\d\s\[\]_,.\-\(\)\+]+\.(?P<extension>\w{1,5}))\"(?!.*\"([\p{L}\d\s\.\[\]_,.\-\(\)\+]+\.\w{1,5})\"))
/
Open regex in editor

Description

When a string contains two or more possible filenames in quotes grab the last one and return it as <filename> and <extension>

Submitted by warlord