Modified to defined pattern in constraint.

Updated so regexp pattern is defined in the constraint and syntax is
checked in the parser.