$folder = $entryfolder->get(); #get the value from the entry widget if ( $folder =~ /[\$\\*&.?\s]/ ) { $dialog = $sw-> Dialog( -title=> 'Alert', -text => "Special characters appear in the name of your folder.", -buttons => qw(OK) ) ->Show(); } #### /[\$\\*&?\s]|^\./