Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add asterisk to the list of valid value characters #75

Closed

Conversation

netux
Copy link

@netux netux commented Aug 8, 2022

My use case was to allows for wildcards with the debug module. E.g. dotenv -v DEBUG=myLib:* node testMyLib.js.
Probably has other utilities too, of course.

Going off of #65, I also forked the regexr pattern and added a new test: https://regexr.com/6rfhn

Allows for wildcards when using the https://npmjs.org/package/debug module (e.g. `DEBUG=myLib:*`).
Probably has other utilities too, of course.
@joaopedroAnelli
Copy link

I have a related issue. In my case, I need to set a variable from command line like DB_PATH=C:\my\path. Although backslash() is not in this regex validation 😢

@@ -47,7 +47,7 @@ if (argv.c) {
}

function validateCmdVariable (param) {
if (!param.match(/^\w+=[a-zA-Z0-9"=^!?%@_&\-/:;.]+$/)) {
if (!param.match(/^\w+=[a-zA-Z0-9"=^!?%@_&\-/:;.*]+$/)) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!param.match(/^\w+=[a-zA-Z0-9"=^!?%@_&\-/:;.*]+$/)) {
if (!param.match(/^\w+=[a-zA-Z0-9"=^!?%@_&\-/:;.*\\]+$/)) {

Is it possible to add backslash?

@entropitor
Copy link
Owner

I'm a bit worried about security issues and I don't have a lot of time to investigate all these regex changes. Are you also using this on Windows? Because otherwise you can use #56 (comment)

@entropitor
Copy link
Owner

I've just tested this with #105 and it seems to work so that's why I closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants