Skip to main content

Hi!

When I try to force user to enter information like

Mustermann, Max

and want to avoid entries like

Mustermann Max

which regex should I use?

I tried it with

[,]s+

but does not work...

Thanks!!!

Jakob

regex is not valid, token is not quantifiable!


Hi Jakob,

This one should do the job :

[A-Za-z]+[,]s[A-Za-z]+


Hi Pierre,

Jakobs regex is working when omitting '+' at the end.

Your solution would not work with names containing e.g. german umlaute.


Exact, I actually tested it with his example in order to find a full exact match, no more reflexion about it sorry happy.png


Jakob Putz can you please mark the answer that helped you as correct?


Reply