Allow to use env variables with '.' in it's name (i.e. REDIS.PUBSUB.PORT)
flamewow opened this issue · comments
currently, if I want to use a variable whose name contains "." (e.g. REDIS.PUBSUB.PORT) the lib is not working.
Should be as simple as changing regex to allow "."
const matches = envValue.match(/(.?\${*[\w\.]*(?::-[\w/]*)?}*)/g) || []
return matches.reduce(function (newEnv, match, index) {
const parts = /(.?)\${*([\w\.]*(?::-[\w/]*)?)?}*/g.exec(match)
if (!parts || parts.length === 0) {
return newEnv
}
the PR #93
our position on variable names is:
For the sake of portability (and sanity), environment variable names must consist solely of letters, digits, and the underscore ( _ ) and must not begin with a digit. In regex-speak, the names must match the following pattern:
https://dotenvx.com/docs/env-file#variable-names
that said, i would like to hear from people who simply do not have control over these env variable names. if so, what service is setting them like that for you? i've never seen that before in the many hosting, db, and other 3rd party services I've used.