Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Pattern Matching

Pattern Matching

2003-03-26       - By Dominique Devienne
Reply:     1     2     3     4     5     6     7     8     9  

How about:

<copy todir="${source_dir}">
   <fileset defaultexcludes="no" dir="${target_dir}">
      <exclude name="**/.wlnotdelete/**" />
      <exclude name="**/_tmp_war/**" />
   </fileset>
</copy>

Does it work? I don't see why directories starting with a dot wouldn't be
matched correctly. How do you know it's because of the dot? --DD

-----Original Message-----
From: Martin Porter [mailto:martin.porter@(protected)]
Sent: Wednesday, March 26, 2003 9:18 AM
To: user@(protected)
Subject: Pattern Matching

I am trying to use a fileset to copy some directories & files to a new
target location as follows:-

<copy todir="${source_dir}">
   <fileset defaultexcludes="no" dir="${target_dir}">
      <exclude name="**/.wlnotdelete**"/>
      <exclude name="**/_tmp_war**"/>
   </fileset>
</copy>

This is working as expected and removing all instances of *_tmp_war
directories in the process
but still leaves all the '.wlnotdelete' directories. I know its because of
the '.' character at the start
of the directory name but I cant find any way of making it work. It must be
a regular expression
matching pattern but I cant find an example of how to do it....anyone got
any bright ideas or pointers
to any docs that might tell me.

TIA
Martin



©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.