MultiFlags

CharSequence inputStr = "Abcndef";
String patternStr = "abc$";

// Compile with multiline and case-insensitive enabled
Pattern pattern = Pattern.compile(patternStr,
    Pattern.MULTILINE | Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(inputStr);
boolean matchFound = matcher.find();    // true

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.