regex - python 3.4 regular expression windows registry -
i'm trying make regular expression return characters between last \ , closing ] .reg files
so far can work using no spaces in last key:
[hkey_local_machine\software\foo\bar\keypath]
using (?<=\\)(\w+)]
but can't handle spaces in last entry e.g:
[hkey_local_machine\software\foo\bar\key path]
i've many different keys , have 2 words while not. i'm still trying grips regular expressions.
maybe alternative:
(?<=\\)[^\\]+(?=]$)
explaining:
(?<=\\) # starting '\' without taking [^\\]+ # character except '\' - many possible (?=]$) # till ending ']' character - without taking
hope helps.
Comments
Post a Comment