I wonder if there is any groovy-way to check if substring of strings matches to patterns.
For example I have strings List (or array):
def Errors = ['File xyz cannot be created: No space left on device', 'File kjh has errors: some_error']
Then I have list of strings, for example def Patterns = ['Tests failed', 'No space left on device', 'Something goes wrong', ...some strings... ]
I would like to check if some elements of List Patterns are substrings of Errors elements .
In that example it should return true, because Patterns has No space left on device and Errors has 'File xyz cannot be created: No space left on device'.
I know how to write it very ulgy and not efficient by using two for loops and method contains, but I know that Groovy has much more powerfull built-in methods. I have tried with findAll(), but it doesnt worked at all.
Do you have any ideas? Is there any way to make it more clever?