-
Notifications
You must be signed in to change notification settings - Fork 61
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
Manage empty values #47
base: master
Are you sure you want to change the base?
Conversation
It can happen that registry values are juste used for their names. (For UpgradesCodes for example)
lib/registry.js
Outdated
@@ -41,7 +41,7 @@ var util = require('util') | |||
, PATH_PATTERN = /^(HKEY_LOCAL_MACHINE|HKEY_CURRENT_USER|HKEY_CLASSES_ROOT|HKEY_USERS|HKEY_CURRENT_CONFIG)(.*)$/ | |||
|
|||
/* registry item pattern */ | |||
, ITEM_PATTERN = /^(.*)\s(REG_SZ|REG_MULTI_SZ|REG_EXPAND_SZ|REG_DWORD|REG_QWORD|REG_BINARY|REG_NONE)\s+([^\s].*)$/ | |||
, ITEM_PATTERN = /^(.*)\s(REG_SZ|REG_MULTI_SZ|REG_EXPAND_SZ|REG_DWORD|REG_QWORD|REG_BINARY|REG_NONE)(\s+([^\s].*)){0,1}$/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{0, 1}
can be replaced by ?
.
I just ran into the same bug, however your solution does not work for me. It gives me My version of reg.exe (10.0.18362.476) appears to use exactly four spaces as delimiters, so this works for me (in combination with removing some unjustified ITEM_PATTERN = /^ (.*) (REG_SZ|REG_MULTI_SZ|REG_EXPAND_SZ|REG_DWORD|REG_QWORD|REG_BINARY|REG_NONE) (.*?)[\r\n]*$/ That is, until we get into the territory of names and values containing |
I find out some values can be empty, so I changed the Regex to manage this case.