Re: AGRegex question
Re: AGRegex question
- Subject: Re: AGRegex question
- From: Koen van der Drift <email@hidden>
- Date: Sat, 11 Feb 2006 07:07:59 -0500
On Feb 10, 2006, at 3:01 AM, Nathan Day wrote:
Yes, the /'s in pearl are the equivalent of double quote but to
define a regular expression instead of a string, the / is not part
of the regular expression itself.
Great, thanks. Looking at the code, though, I was wondering which is
faster/better/easier:
regex = [AGRegex regexWithPattern: @"^\\s*foo\\s*$"];
regexMatch = [regex findInString: currentLine];
if (regexMatch)
{
...
}
or:
if ([[currentLine stringByTrimmingCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]] isEqualToString: @"foo"])
{
...
}
- Koen.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden