I'm trying to formulate an <expression> that will match any of the following:
*.jpeg
*.jpg
*.JPEG
*.JPG
for a 'find <directory> -name <expression> ' command. I'd like to do *.[jJ][pP][eE<null>][gG], but don't know what the null character is, or even if it exists. Any thoughts on how to implement this? Thanks.
Sure, I thought about that, but that would match *.jpig, *.jpog, *.jpanythingyouwantg, etc. I'm looking for a more exact expression. Obviously your suggestion would work 99.999999% of the time though. I think an even better one would be *.[jJ][pP]?[gG] since ? restricts the wildcard to a single character, but still not quite what I'm looking for.
I'm not sure why you think you need this, ASCII NUL is the end of a string. The dirent struct member d_name is a char *. So it will be interpreted as ending with the character before the NUL.