ANONYMOUS wrote:
"The wildcard characters *, ?, [ ], and { } are widely supported."
That's a general statement that different shells will support slightly different syntaxes to offer filename expansion.
The function glob2regex()
provided for this project supports only a very basic subset of what shells broadly support (with very little error checking).
I understand how the '*' wildcard works from personal usage but not the rest. I've found some online information with my partner that I believe defines how to use the '?' wildcard correctly.
Here's some short links links about the common ones in the standard shell ````bash``` :
https://linuxg.net/bash-wildcards-question-mark-and-asterisk/
https://linuxg.net/bash-wildcards-the-square-brackets-and-the-curly-brackets/
https://linuxg.net/the-bash-wildcards-practical-examples/
I want to ask you (Chris) how you're expecting these work because I could go by any online definition I come across but it may not be the same as what standard you have and will be marking with.
Your project is not expected to validate or support all the types of wildcards supported by shells (we could possibly use the function described by man 3 glob
but it's not the focus of the project). Simply take the result from a successful call to glob2regex()
and use regcomp()
and regexec()
to match, or otherwise, each filename that your program locates.
Your project will not be tested with anything more complex than *.c
, a???.txt
, or *.[ch]
, but your code to match patterns will not be dependent, or have to consider, the glob patterns provided.