You can only use square brackets for characters, not for sequences of characters. So instead of e. g.
all_chars [{letter}{digit}_]
you'll have to write
all_chars ({letter}|{digit}|_)
And you shouldn't mix pipe signs and square brackets. [abc] means the same as (a|b|c), but [a|b|c] is wrong.