thank you for your response, but i'm not sure i understand your
advice - the command you've suggested would tell me if
$mystring is an accepted command. that doesn't really matter to
me. i don't care if they've used accepted commands, since i'm
going to run a subst on $mystring (which, by the way, contains
more than just one command).. here's an example:
mystring:
"This is a text string that contains commands. The command in
this sentence is [retrieve_image 142] and should be left alone,
since it's in the accepted_commands list. However, the
command in this sentence, which is [delete_all_files] should
trigger my regexp, so I can tell the person who wrote this string
that they had an unacceptable command."
with the above example of $mystring, an error needs to be
returned. if the command [retrieve_image] was not in the above
string, i would still get the same result - an error. but if the
command [delete_all_files] was not in the above string, my
error-checking would just leave $mystring alone, and i would run
subst on the whole string. does this make sense?