Quote:

How would you do it?




i'd use c++ to filter out the disallowed stuff. (istringstream, readline, substr, replace...)
translate the string into single instructions (; as separator) into a list, and delete everything that's illegal.

joey.