How can i create a constraint in my survey form?

You could use the regex code to make a constraint as discussed in the post discussed previously:

You should be able to learn more about regex through our support article Restricting Text Responses With Regular Expressions.