I need to only allow following characters in multi-line textarea input field:
space, numbers, English letters and following special characters: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ ` [ \ ~ ] ^ _ { | }
I figured it out except the multi-line part:
[RegularExpression("^[ -~]+$", ErrorMessage = @"Allowed characters for item description: space, numbers, English letters and following special characters: ! "" # $ % & ' ( ) * + , - . / : ; < = > ? @ ` [ \ ~ ] ^ _ {{ | }}")]
It works as desired as long as everything is entered as a single line. I just can't figure out how to extend it to multi-line.
"^[ -~]+(?:\r?\n[ -~]+)*$""^[ -~]*(?:\r?\n[ -~]*)*$"