我如何使用南特/蚂蚁命名模式? [英] How do I use Nant/Ant naming patterns?

查看:151
本文介绍了我如何使用南特/蚂蚁命名模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不得不承认,我总是忘了南特的命名方式(例如那些文件集使用)的语法intracacies。双星/星号的东西似乎是在我的心里很不起眼的。

I have to admit that I always forgot the syntactical intracacies of the naming patterns for Nant (eg. those used in filesets). The double asterisk/single asterisk stuff seems to be very forgettable in my mind.

有人可以给命名模式提供了明确的指导?

Can someone provide a definitive guide to the naming patterns?

推荐答案

规则是:


  • 一个星号(*)匹配零个或多个字符的的路径名中

  • 双星(**)匹配零个或多个字符的跨目录级别

  • 一个问号(?)与一个字符匹配的路径名中

要想想另一种方式是双星(**)匹配斜线(/),但单星号(*)不会。

Another way to think about it is double star (**) matches slash (/) but single star (*) does not.

假设你有文件:


  1. 跳回到bar.txt

  2. 的src / bar.c

  3. 的src / baz.c

  4. 的src /测试/ bartest.c

然后图案:


  • * C            比赛没有(有在当前目录中没有.c文件)

  • 的src / * C     匹配2和3

  • * / * C         匹配2和3(因为*只匹配一个级别)

  • ** / * C       比赛2,3,4(因为**匹配任何数目的水平)

  • 酒吧*         匹配1

  • ** /酒吧*   符合1和2

  • ** /酒吧*。* 2,和4
  • 匹配1,
  • 的src / BA?.C 匹配2和3
       

  • *.c             matches nothing (there are no .c files in the current directory)
  • src/*.c     matches 2 and 3
  • */*.c         matches 2 and 3 (because * only matches one level)
  • **/*.c       matches 2, 3, and 4 (because ** matches any number of levels)
  • bar.*         matches 1
  • **/bar.*   matches 1 and 2
  • **/bar*.* matches 1, 2, and 4
  • src/ba?.c matches 2 and 3    

这篇关于我如何使用南特/蚂蚁命名模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆