boolean (char flag, PsiElement context) { return switch (flag) { case 'i' -> true; // case-insensitive matching case 'd' -> true; // Unix lines mode case 'm' -> true; // multiline mode case 's' -> true; // dotall mode case 'u' -> true; // Unicode-aware case folding case 'x' -> true; // whitespace and comments in pattern case 'U' -> // Enables the Unicode version of Predefined character classes and POSIX character classes hasAtLeastJdkVersion(context, JavaSdkVersion.JDK_1_7); default -> false; }; }