-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
  • 10,870
  • 5
  • 35
  • 75
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,506
  • 1
  • 12
  • 24