Regex for \have to contain"

  • 29 March 2017
  • 5 replies
  • 2 views

Badge +3

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


5 replies

Badge +9

regex is not valid, token is not quantifiable!

Badge +7

Hi Jakob,

This one should do the job :

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

Badge +9

Hi Pierre,

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

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

Badge +7

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

Badge +9

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

Reply