因为我现在正在使用windows注册表。。我总是发现以下模式。。注册表包含两个括号{},中间有数字和字母,您可以看到下面的一些示例:
HKEY_CLASSES_ROOT\Drive\shellex\FolderExtensions\{fbeb8a05-beee-4442-804e-409d6c4515e9}
HKEY_CLASSES_ROOT\CLSID\{00BB2763-6A77-11D0-A535-00C04FD7D062}\InProcServer32
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2\CPC\Volume\{64dcb6fa-03c9-11e6-9e9f-806d6172696f}\
有谁能帮助我理解这些是指什么?它们是随机生成的吗?在
我还试图解析每个注册表项并删除方括号{}之间的任何内容。。首先,我知道这可以用正则表达式实现,但我真的不熟悉它们。。欢迎任何指导。在
当您用
Python
标记问题时(用2.7
测试):代码片段提供了所有不带大括号的键。感谢@Liam之前指出了一个错误。
提示:我是一个Mac用户,但是,我很确定大括号是有必要的,不是吗?在
将
{.*?}
替换为{}
(如果一行有两个guid,则使用lazy dot)demo
字符串是Globally Unique Identifiers。从here:
在这种情况下,正则表达式是最好的。只需使用:
相关问题 更多 >
编程相关推荐