wildcard : Java Glossary


In Windows BAT (Batch) language you can refer to all files in a directory as *.html or all files a?.html for all two-letter files starting with a. The way you specify such a group of files is called a wildcard. * matches any string. ? matches any single character.


Using cmd.exe as the command processor, or Take Command tcc.exe, wildcards behave in a way that may surprise you.

IntelliJ Idea under Windows

Using the IntelliJ Idea IDE (Integrated Development Environment) to run programs, wildcards behave in a way that may surprise you.

Bash under Linux

Using bash as the script processor, wildcards behave in a way that may surprise you. I am also told in Linux/bash you can subvert the globbing with \ quoting, e.g. \*.html Then your program will get the command-line parameters unexpanded. See parameter expansion in bash for more details.


It is probably easier to understand this by experiment than by explanation. Here is a simple tool to help you.

Converting Wildcards to Regexes

You can convert a wild card


This wildcard expansion mechanism is Mikey Mouse. It does not work for wildcards containing spaces. It is confusing for wildcards without matches. It makes it difficult to pass * or ? as data. I think the best way out is for Sun to provide an alternate mechanism to passing the entire command line completely unmodified.

This page is posted
on the web at:


Optional Replicator mirror
of mindprod.com
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number