isCaseSensitive property Null safety

bool isCaseSensitive

Whether this regular expression is case sensitive.

If the regular expression is not case sensitive, it will match an input letter with a pattern letter even if the two letters are different case versions of the same letter.

final str = 'Parse my string';
var regExp = RegExp(r'STRING', caseSensitive: false);
final hasMatch = regExp.hasMatch(str); // Has matches.
print(regExp.isCaseSensitive); // false

regExp = RegExp(r'STRING', caseSensitive: true);
final hasCaseSensitiveMatch = regExp.hasMatch(str); // No matches.
print(regExp.isCaseSensitive); // true


bool get isCaseSensitive;