specialCharStr top-level property
A regular expression pattern that matches strings containing only special characters.
This pattern allows one or more of the following characters:
! @ # $ % ^ & * ( ) , . ? " : { } | < >
Note: It will not match strings that contain letters, digits, or whitespace.
Implementation
String specialCharStr = r'^[!@#$%^&*(),.?":{}|<>]+$';