regex - unable to match this regular expression in python -


i trying match regular expression using python in code.

cds_regex = re.compile(r'\+cds:\s*"([^"]+)",\s*(\d+)$') cdsimatch = alllinesmatchingpattern(self.cds_regex, notificationline) print cdsimatch 

matching string:

['+cds: 24', '079119890400202306a00aa17909913764514010106115225140101061452200'] 

please me not able find mistake,

  1. as @blckknght said, sure want match string?
  2. what ([^"]+) supposed match?
  3. you're looking " instead of ' (you want ['"]).
  4. you're checking numbers here: (\d+), long string contains a's.

Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -