title: How to validate first name Objective-C?
body: <p>I am trying to validate a first name in Objective-C. Please note that the name can contain spaces and only letter.</p>
  
  <p>Here my code that is not working:</p>
  
  <pre><code>NSString *nameRegex = @"^[A-Z][a-z]*[\\s{L}\\s{M}\\s{Nl}][A-Z][a-z]*$";
  NSPredicate *nameTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", nameRegex];
  BOOL isValid = [nameTest evaluateWithObject:name];
  return isValid;
  </code></pre>