From the documentation
The Contains Condition can be used to check whether string, variable value or file content contains a given pattern.
The pattern can be a plain string or a regular expression.
So the condition should be true, if the value is a substring of the content. This works well with option regex="false". But with regex="true" the regular expression given in value has to match the whole content.
In this example, the first condition will evaluate true, but the second one false.
Is this intented? I do not think so.
Adding a prefix and a suffix to an user supplied regex pattern could have side effects (with line delimiters, ...)
So using Matcher.find() instead of Matcher.matches() will find substrings instead of whole strings.
Even this could break existing installers I would suggest to fix this behaviour, because "Contains" is clearly understood as a search for substrings.
Sent pull request 510.
The boundaries ^ and $ did not work as supposed for multiline matches