0
votes

I'm am trying to pattern make a form attribute to accept only Text and numbers with no White space and no Special characters. I Tried several Regex expressions, but it doesn't go, Please help. Here is my code for the Form flow attribute

[Pattern(@"^[\w,\s-]+\.[A-Za-z]{3}$")]
1
Then why use ,\s- and \. in the pattern? How do you define Text and numbers?Wiktor Stribiżew

1 Answers

2
votes

I recently used

^[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df]+[a-zA-Z\u00c4\u00e4\u00d6\u00f6\u00dc\u00fc\u00df0-9_]*$

It includes the german Umlaute (äöüÄÖÜ) as well as the Eszett (ß) i think. You can remove all those \uXXXX characters