make sure _flatten_ is not already used

use a regex expression which matches the entire word so
sub-matching doesn't occur. e.g. if the user had __flatten__
the regex pattern would not flag that.