I've been working a lot with regex and texts lately and come across an unexpected behaviour of the finds() expression. Whenever there is a line feed in the text, finds() without modifiers will always return false, even finds(TextAttribute,"."). Using the dotall mode, finds(TextAttribute, "(?s)."), it matches any substring of the first line but not of the following lines. So what's apparently happening in the background is that finds(TextAttribute,"(?s)expression") is translated to matches(TextAttribute,".*(?s)expression.*"). Can anyone reproduce this behaviour and can confirm that this is happening? If so, I think there is a find() method in Java that could be used to solve this problem. I don't have any experience in Java though, and there might be a reason for not using that.
So far I've simply used matches() with dotall mode instead of finds(), which works fine for me. But in case anyone can reproduce the behaviour of the finds() expression, it might be useful for others, who rely on this expression, to know about that behaviour.