Answered by npinti below. The C# answers were not helpful at all in the 'similar question'.
So I have the following regex. I also tried different variations of this, but it will not work unfortunately.
So if I have the below string and would like to extract 23, 22 and 38
.
But I don't want it to extract the the numbers that are separated with a hyphen and also no negative numbers: -
.
string = 'Have to find 23, but not 44-58 and definitely not 88-99 but do find 22 & 38'
my_regex = re.compile(r'(\d+)|^((?![0-9]+[^-]^[0-9]+).)*$', flags=re.I)
print(my_regex.findall(string))
This basically returns nothing useful.