Looking for Help on some ASOC code
Looking for Help on some ASOC code
- Subject: Looking for Help on some ASOC code
- From: Stephen Magladry <email@hidden>
- Date: Wed, 28 Sep 2011 16:35:32 -0700
I am trying to validate a text field for an email address. I found this Objective C code that will validate a NSString to make sure it is a proper email address.
+ (BOOL)validateEmail:(NSString *)email { NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; return [emailTest evaluateWithObject:email]; }
How would I either:
a. Convert this to Applescript.
b. Leave it as Objective C and call it from my Applescript code.
Assume the string I will be handing off is a simple Applescript string.
Thanks.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden