Skip to content

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 😢


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.

3 participants