Im trying to use a regex expression to validate a full name for a textfield form in flutter but i cant figure out why it isnt working.
The expression i found from here /^[a-z ,.'-]+$/i
is failing for any entry i give.
The code i'm using in dart for my flutter app is:
final RegExp nameExp = new RegExp(r"/^[a-z ,.'-]+$", caseSensitive: false);
Can anyone see what i'm missing?
Update: so the regex was allowing most things and wasnt quite correct, what worked for me was r"^([a-zA-Z]{2,}\s[a-zA-z]{1,}'?-?[a-zA-Z]{2,}\s?([a-zA-Z]{1,})?)"
with the accepted answer below