That's not necessarily a bad way to do it, but everyone should be aware that if there are any metacharacters in $b and \E precedes them, the metacharacters will be parsed as metacharcters.
IOW, if $b == "???\E?", the fourth '?' will be not be matched literally.
The only real advantage to punk music is that nobody can whistle it.