I have a text file like this:

```
771 776 #1 556.766700(2)
538 #2 1069.652700(2)
531 #3 1074.407600(2)
81 84 89 94 111 #4 1501.062900(2)
85 91 #5 782.298900(3)
32 42 66 71 90 95 101 #6 904.016500(3)

```

I want to split and save the substrings to different variables as follows:
for example in line 1: 

```
scans= 771 776, uid = 1 mz = 556.766700, z = 2

```

I am trying to use the following code but I need help with the regex:

```
f = open(filename, 'r')
par_info=[]
for rows in f:
    re.sub('\#(.+)\s(.+)\((.+)\+', scans=\g<1>, uid=\g<2>, mz = int(\g<3>),    z=int(\g<4>), rest)
    info={'sc_num':scans, 'ident':uid, 'mass':mz, 'charge':z}
    par_info.append(info)

```