I'm struggling with understanding the syntax of repeated regex patterns in python. This is my code:
import re
string='''
-GOLD- 10181914 93D 1 1.00000 0.00000
58 61 0 0 0 0 0 0 0 0 1 V2000
3.4354 -3.4974 -16.5634 N 0 0 0 0 0 0 0 0 0 0 0 0
4.5427 -4.0070 -16.0569 C 0 0 0 0 0 0 0 0 0 0 0 0
5.5389 -3.2151 -15.7189 N 0 0 0 0 0 0 0 0 0 0 0 0
6.3839 -3.5953 -15.3094 H 0 0 0 0 0 0 0 0 0 0 0 0
'''
line_pat = '([+-]*\d+.\d+\s+){3}\w+'
print(re.findall(line_pat,string))
What I'm trying to capture are all the lines, which contain the three floats and the capital letter as: "3.4354 -3.4974 -16.5634 N". Why no gusto?