I see no reason why this should not work. But, even though the stringCHK is converted to a pattern for you, it is a bad idea to do so, and you should use a pattern yourself in the first place. There's only one case in which a string used there has an actual, "special" semantic meaning, and it's not this one...