Test, validate and match regular expressions
Validates HTTP User-Agent strings by matching product tokens (name/version pairs like 'Mozilla/5.0'), parenthesized comments with semicolon-separated details (e.g., '(Windows NT 10.0; Win64; x64)'), and optional plus signs in versions. It enforces no leading/trailing whitespace and rejects malformed versions such as ones ending in a dot or having a dot immediately after the slash. Used with global/multiline flags for validating User-Agent headers in HTTP requests.