Search code examples
javadirectorywildcardsubdirectoryjedit

Wildcards in regular expression in directory paths for search/find?


This should be really simple. This directory C:/ Users/matt/Documents/*/xyz123 should match any directory in C:/ Users/matt/Documents/ "that contains a sub-directory" called xyz123.


Solution

  • Assuming that you can access files in the format given, and this is standard regular expression syntax, then you need a . before the *, as in:

    C:/ Users/matt/Documents/.*/xyz123
    

    * just means 0 or more of the preceding.
    . stands for any character except for the new-line character