パターン マッチング リファレンス

Bamboo supports a powerful type of regular expression for matching files and directories (as with pattern matching in Apache Ant).

These expressions use the following wild cards:



Matches one character (any character except path separators)

*
Matches zero or more characters (not including path separators)

**
Matches zero or more path segments.


Remember that Ant globs match paths, not just simple filenames.

  • If the pattern does not start with a path separator i.e. / or \, then the pattern is considered to start with /**/.
  • If the pattern ends with / then ** is automatically appended.
  • A pattern can contain any number of wild cards.

Also see the Ant documentation.

*.txt
Matches /foo.txt and /bar/foo.txt but not /foo.txty or /bar/foo.txty/

/*.txt
Matches /foo.txt but not /bar/foo.txt

dir1/file.txt
Matches /dir1/file.txt, /dir3/dir1/file.txt and /dir3/dir2/dir1/file.txt

**/dir1/file.txt
Matches /dir1/file.txt/dir3/dir1/file.txt and /dir3/dir2/dir1/file.txt

 /**/dir1/file.txt
Matches /dir1/file.txt/dir3/dir1/file.txt and /dir3/dir2/dir1/file.txt

/dir3/**/dir1/file.txt
Matches /dir3/dir1/file.txt and /dir3/dir2/dir1/file.txt but not /dir3/file.txt,/dir1/file.txt

/dir1/**
Matches all files under /dir1/

 

最終更新日 2017 年 9 月 28 日

この翻訳に満足しましたか?

はい
いいえ
この記事についてのフィードバックを送信する

お探しの情報が見つかりませんか?

コミュニティへの質問

Powered by Confluence and Scroll Viewport.