Regex for Testing A Number Range

Kinda weird, but if you are scanning a file from a build tool for coverage you can do a check by finding your value and using this reg-ex statement:

2[7-9]|[3-9][0-9]|100

This statement will check 27-100.

Regex only does string searching but this works — I can use this in something like the Maven Verification plugin to fail my coverage.

Comments are closed.