You could create a regex that checks the string for the characters you want to allow, e.g.:
sub isStrOK { return $_[0] =~ /\A[\s\w]+\z/; }
The above's not intended to be exhaustive for allowable characters, but only an example.
In reply to Re: Detecting if a string is a regular expression
by Kenosis
in thread Detecting if a string is a regular expression
by smontsar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |