Regular Expressions 101

Community Patterns

Group variable attributes in a linux path effectively with regex

1

Regular Expression
PCRE (PHP <7.3)

/
.*(workspace?[0-9]?[0-9]).*\/(.*)\/src\/.*
/

Description

Group variable attributes in a linux path effectively with regex. Here the workspace can be changed and the modulename can change. Case scenario found trying to identyfy the modulename and workspace directory in Jenkins build.

Submitted by Supratim Samanta - 9 years ago