I tested this regular expression
test_reg = r"(?<=\(|\s)\d+\s?(?=((?:\s*(?:wh|www)[1-9]?\s?){1,3}))\1\b"
on the following three examples:
high energy densities (695 wh www ) at
high energy densities (695 wh www) at
high energy densities (695 wh www at
From the result (regex101), the ')' in the first example somehow makes the match failed, and delete it solves the problem. I don't understand why.