Jul-23-2018, 07:48 AM
Hi, I am currently working on regex string matching in order to find line with 2 digits:
Example:
[10:3] abc
I am expecting the output will write in file as: 10&3
However, the output shown is: 10&,
It seems that the thought that comma (,) is the min value. Is there any way to get the correct max and min?
Example:
[10:3] abc
I am expecting the output will write in file as: 10&3
However, the output shown is: 10&,
It seems that the thought that comma (,) is the min value. Is there any way to get the correct max and min?
1 2 3 4 5 6 7 |
if re.match(r "\[-?\d*:?-?\d*\]\s*\S*" , str ): aa = re.findall(r '\d+' , str ) ab = "," .join(aa) high = max (ab) low = min (ab) result = f.writelines(high + "&" + low) return result |