Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > double '*'

Reply
Thread Tools

double '*'

 
 
Alain Laroche
Guest
Posts: n/a
 
      12-21-2004
Hi,

in ant files I often see a double star "**" instead of a single star in
patterns given as arguments to some attributes.

Example:
<patternset id="non.test.sources">
Â*Â*<includeÂ*name="**/*.java"/>
</patternset>


Why are two '*' needed,as a single star already matches any number of
characters? Is there a difference with <include name="*/*.java"/>?

Thank you.
 
Reply With Quote
 
 
 
 
Joona I Palaste
Guest
Posts: n/a
 
      12-21-2004
Alain Laroche <> scribbled the following:
> Hi,


> in ant files I often see a double star "**" instead of a single star in
> patterns given as arguments to some attributes.


> Example:
> <patternset id="non.test.sources">
> Â*Â*<includeÂ*name="**/*.java"/>
> </patternset>



> Why are two '*' needed,as a single star already matches any number of
> characters? Is there a difference with <include name="*/*.java"/>?


> Thank you.


It's a special trick. "**" isn't parsed as two '*', it's a special token
on its own right, meaning "every subdirectory inside this directory, no
matter how deep in the directory tree".

--
/-- Joona Palaste () ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"C++ looks like line noise."
- Fred L. Baube III
 
Reply With Quote
 
 
 
 
John C. Bollinger
Guest
Posts: n/a
 
      12-21-2004
Joona I Palaste wrote:

> Alain Laroche <> scribbled the following:
>>Why are two '*' needed,as a single star already matches any number of
>>characters? Is there a difference with <include name="*/*.java"/>?

>
> It's a special trick. "**" isn't parsed as two '*', it's a special token
> on its own right, meaning "every subdirectory inside this directory, no
> matter how deep in the directory tree".


And a single * _doesn't_ match just any arbitrary sequence of
characters. In particular, it doesn't match anything that involves
traversing a subdirectory as part of the match.


John Bollinger

 
Reply With Quote
 
Alain Laroche
Guest
Posts: n/a
 
      12-22-2004
Joona I Palaste wrote:

> It's a special trick. "**" isn't parsed as two '*', it's a special token
> on its own right, meaning "every subdirectory inside this directory, no
> matter how deep in the directory tree".
>


Thanks Joona.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
from List <double> to double[] Web learner ASP .Net 3 04-26-2006 05:26 PM
Should I be concerned about buying DVD18s (Double-sided, double-layered) The Man With No Name DVD Video 3 02-04-2006 01:45 AM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM
Double double display display problem problem Tom Accuosti Firefox 3 09-27-2004 10:02 PM
structs of double as double[] sb C++ 4 02-19-2004 07:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57