Regular Expressions 101

Community Patterns

math chain comparisons with optional matched paren

2

Regular Expression
Python

r"
(?<![-+\/*(\s])((\s*\()?(?:(?:\s*\$Q\w+\s*|\d+\.?\d*\s*)[-+\/*])+(?:\s*\$Q\w+|\d+\.?\d*)\s*(?(2)\)))(\s*[=!><]+\s*)(\d+\.?\d*)
"
x

Description

no description available

Submitted by anonymous - 8 years ago