Groovy web console

subscribe to the feed Subscribe
to this
site
ajp (via #groovywebconsole)
tweet this snippet Tweet
this
script

ajp

Published 3 months ago by ajp-solved
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def regex = /^(?=.*?Read timed out)(?!.*?I_AM).*$/

//match here
assert '''Error 'I/O error on GET request for "http://---": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out' occurred from (blah...). Retrying.''' ==~ regex

//do not match here'
assert !('''Error 'I/O error on POST request for "https://---": Read timed out; nested exception is java.net.SocketTimeoutException: Read timed out' occurred from (I_AM_THE_GUY) esize the script view by sliding down the bottom of the line number gutter.''' ==~ regex)