Reg expression for finding expression in sentence
Since you only have two characters to compete with, namely, &lt; and &gt;, use a character set. Other than that, you might consider \d matching your digits, instead of 0-9 as \d covers the numerical characters across the entire UTF8 range.

The final expression would be:

duration\s*([&lt;&gt;])\s*(\d+)


I've left the matching groups in place, considering that you might be referencing them in your later code.