Because * doesn't cross subdirectories. It only matches files in the current directory. To cross a directory boundary, you need **.
You might want to go through a tutorial on glob pattern before attempting questions on this topic.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
Look at the explanation for third variant:
"Square brackets [] are used to specify multiple options for a single character. Therefore, the above pattern will match a.h, a.t, a.m, a., a.x and a.l but not a.htm or a.xml."
I think instead of "a." must be "a," (a comma, rather then a dot).
Ok, I understand the problem now. The explanation is correct but it is missing a comma after a,. I.e. it should say, "the above pattern will match a.h, a.t, a.m, a.,, a.x and a.l but not a.htm or a.xml."
I couldn't see earlier that that comma was missing. So the bottom line is it will not match a, (a comma) but it will match a., (a dot comma) because of the reason mentioned in the explanation.
-Paul.
If you like our products and services, please help us by posting your review here.
Exception in thread "main" java.lang.UnsupportedOperationException: Syntax 'GLOB' not recognized
at sun.nio.fs.WindowsFileSystem.getPathMatcher(WindowsFileSystem.java:299)
at javaapplication219.JavaApplication219.main(JavaApplication219.java:21)
C:\Users\Media\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1
what you mean "without regard to case"?
or you mean this part:**.{htm*,xml}
glob: is part of the syntax of glob pattern. It has to be lower case. It is the case of the actual pattern that is being referred to in the explanation i.e. htm or HTM.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.