isPersian static method
Validates if the input string contains only Persian characters @param input The string to validate @param complex Whether to use complex Persian character set @returns bool True if input is valid Persian text Example: PersianTools.isPersian("سلام") => true
Implementation
static bool isPersian(String input, {bool complex = false}) {
if (input.isEmpty) return false;
final RegExp pattern = RegExp('["\'-+()؟\\s.]');
final String rawText = input.replaceAll(pattern, "");
final String faRegExp = complex ? _faComplexText : _faText;
return RegExp("^[$faRegExp]+\$").hasMatch(rawText);
}