Added a method to check constrained strings