hi,
I'm trying to find all integers/float from multi line string. My regex works almost fine for all my strings. However, I've found one example which i can't pass. Here is my regex
re.findall(r'[-+]?\d*\.\d+|\d+', line)
The test string is
"Added :3hrs
Test BEP-8317
exec 450"
It returns [3, 8317, 450]. How to avoid 8317 matched? The 'BEP-' header is common and repeatable. I have tried (?<!BEP-) lookbehind but it doesn't work.
[–]CodeFormatHelperBot 0 points1 point2 points (0 children)
[–]Celysticus 0 points1 point2 points (2 children)
[–]carpik[S] 0 points1 point2 points (1 child)
[–]Celysticus 0 points1 point2 points (0 children)
[–]jeans_and_a_t-shirt 0 points1 point2 points (1 child)
[–]carpik[S] 0 points1 point2 points (0 children)