Regular Expression to fail Team City build
<p>I'm using Team City to trigger a script that does some performance testing and generates an output in this format: <strong>"Publisher 0, Rate:  45600 /s"</strong>. The only thing that changes in the output is the rate number (in this example, 45600).</p>

<p>Basically, I need to fail the build in case my rate is under 50000. I'm using Team City Failure Conditions (regex), however I'm struggling to find a regular expression that would identify if this number is &lt; 50000.</p>

<p>This is what I got so far:
<strong>^[0-4][0-9]?[0-9]?[0-9]?[0-9]?$|^50000$</strong> ---> this would identify any number in the logs where the rate number is &lt; 50000, however there are heaps of logs data, then it would identify other numbers that I'm not interested, so this doesn't do what I need. Another downside is that this regex doesn't capture numbers that have something else (strings) before it, so it doesn't even identify the number in the format I want ----> "Publisher 0, Rate:  45600 /s"</p>

<p>Another attempt was using this regex: <strong>Rate:\s+\K\S+</strong>
It only matches the number after "Rate" which is exactly what I want! However, I couldn't find a way to match the number <strong>only when number is &lt; 50000</strong>
Also, Team City doesn't allow the use of "\K", so I need to find a different solution.</p>

<p>Here are a few log entries that I'm using for regex testing purposes:</p>

<ul>
<li>Publisher 0, Rate:  45600 /s</li>
<li>Publisher 0, Rate:  50001 /s</li>
<li>10</li>
<li>100</li>
<li>1000</li>
<li>10000</li>
<li>50001</li>
<li>100000</li>
</ul>

<p>ps: in this case, a successful regex for me would be the one that only matches "45600".</p>

<p>Any ideas/suggestions?</p>

<p>Thanks for your help.</p>

<p>Cheers!</p>