1

I would like to validate insert a string into core data only if it is an valid email address. Sorry I misunderstand the regex. It is enough to give a valid regex in regex field given for the field to validate.

karthik
  • 19
  • 2
  • Please use the search function of this site (or just use google), which would have led you to this question: http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address – l4mpi Nov 27 '12 at 11:50
  • Use the regular expression as: [A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4} Don't forget to put \ or whatever which is used to consider escape sequences as literal when using it as an string. For example, if you want to use the above regex to create NSRegularExpression object, the string for the method should be [A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4} – karthik Nov 27 '12 at 11:51

0 Answers0