You're absolutely right: the glob replacement is incorrect. Worse, it worked "close enough" that I managed to think I had done it right. I appreciate you pointing that out, I'll work on fixing that.
To be perfectly honest, building regexps on the fly seemed clever at the time, but I'm not really sure it bought us that much. I was thinking in terms of typical shell usage, where *.conf refers to any file ending in ".conf". But the reality is, /\.conf$/ matches that already, with no need to explicitly name a wildcard. Additionally, I ended up using anchors in the strings, which is precisely what I was trying to avoid.