-4

My data has this struture:

ID 12354 linea+b 3
ID 15687 linea+b 7
ID 26894 linea+b 10

This is my proposition: r'ID\s+([0-9]+)\s+linea+b\s+([0-9]+)\s+' The problem is with linea+b where python does not accept + as a string, it analyzes it as a metacharacter.

Josh Friedlander
  • 8,209
  • 4
  • 32
  • 67
sony
  • 3
  • 2

1 Answers1

0

You should add \ in front of + to recognize the symbol, not as an increment

r'ID\s+([0-9]+)\s+linea\+b\s+([0-9]+)\s+'
YusufUMS
  • 1,421
  • 1
  • 10
  • 23