How would I write the following in PHP using wildcards?

Hopefully this makes sense: Using PHP, I want to use wildcards to create an expression that refers to any child folder (subfolder) relative to the current folder. How would I do that?

It depends on what you’re trying to do with them (get all files from within them, list them as strings, etc.), but a starting place might be the RecursiveDirectoryIterator.

Wildcards in most languages are independent of file system structures, so it’s kind of hard to answer that without knowing the context of your code.

Thanks for the link, but what I hoping to get was a regular expression that could be used in PHP.

glob() works with wildcards. This will return an array of the names of immediate subdirectories:

Well, PHP does support regular expressions, but typically regular expressions by themselves have no awareness of folder structure or even a way to interact with the filesystem.

Regular expressions interact with strings. Do you have a list of folders and subfolders that you want to do a regex match against?