The most important thing to remember is that the pattern has to match the whole path. We're not searching for a pattern in the filename, we're trying to match the whole path against the pattern. Now let's get to some examples:
| pattern | comment |
^.*/(build|mysource|mylogfile|Event2| | will not match file "build/srs_build.py" because according to the pattern the "build" has to be preceded by "/" |
^ | will not match file |
^.*( | will match files:
as well as:
|
^.*/( | will match file:
but will not match file:
|
^/( | will not match " |
Hopefully it sheds some light onto this area of Bamboo. If you have a questions regarding the constructing of regular expressions for your needs you may want to ask that question on answers.atlassian.com.
4 Comments
PiotrA
Jan 26, 2012Note when using SVN repository the Bamboo will match the full filename, even the part not explicitly set in the repositoryUrl field.
i.e. if your repository structure looks like:
And you set up a Bamboo Plan to use repositoryUrl "http://mysvn.company.com/trunk", then to exclude "uninteresting" files from projB and projC you still need to supply the "/trunk/" prefix in the regexp, like this one
instead of - more intuitive - this one
Anonymous
Mar 22, 2012how about supporting variable expansion in include/excludes?
Is it currently possible to do?
PiotrA
Mar 22, 2012I think variable expansion in include/exclude files is not currently supported (but I think it could be - do you care to raise a BAM feature request on jira.atlassian.com?)
Charles Scott
Mar 22, 2012ok will do. thanks.