I am trying to create a checkstyle rule where I want to prevent the use of "Company.INSTANCE.getProduct" from the below line.
private final Customer customerObj = Company.
INSTANCE.getProduct();
I added the below module in checkstyle xml.
<module name="RegexpMultiline">
<property name="format" value="Company[\s\n\r\R]*\.[\s\n\r\R]*INSTANCE[\s\n\r\R]*\.[\s\n\r\R]*getProduct"/>
<property name="message" value="Do not use Company Instance."/>
</module>
However, it does not work for multiline statements as in the above example. What am I doing wrong here? My regex works as tested in regex101.com
