Test, validate and match regular expressions
This regular expression is designed to extract numbers, including decimals and thousands separators, from specific positions within a string. It matches a number that is immediately followed by a parenthetical statement (e.g., "123 (units)") or a number located at the end of the string. The pattern uses positive lookaheads to ensure the surrounding text matches without including it in the final result. It is commonly used in data cleaning, parsing documents, or extracting values followed by context clues.