putting things of different semantic/logical nature into one place--especially with extensibility in mind--is bound to cause problems sooner or later. better to have a separate variable or other structure attached to the string, which will contain any special things like special placemarkers. Then you have a clean string variable to match against.
the hardest line to type correctly is: stty erase ^H