Forum OpenACS Q&A: Response to help with a regexp

Collapse
Posted by Ronaldo Carpio on
First, stick the accepted commands into an array:
foreach command $accepted_command_list {
  set acceptedCommands($command) 1
}
foreach {match command} [regexp -all -inline {[(w*)[^]]*]} $mystring] {
  if {![info exists acceptedCommands($command)]} {
    error "$command is not an accepted command"
  }
}