Community Patterns

Community Library Entry

1

Regular Expression
Created·2020-08-10 22:34
Flavor·Golang

`
((\.{2}\/{1})+|((\.{1}\/{1})?)|(\/{1}))(([a-zA-Z0-9]+\/{1})+)([a-zA-Z0-9])+(\.{1}[a-zA-Z0-9]+)?$
`
Open regex in editor

Description

Find all string matches with dir, one or more subdir, file name with optional extension.

Common example with all capturing groups included:

../../dir/SubDir1/SubDir2/file.ext

Note that Full path can begins with ./ or / patterns.

Submitted by anonymous