Re: AGRegex question
Re: AGRegex question
- Subject: Re: AGRegex question
- From: Nathan Day <email@hidden>
- Date: Sun, 12 Feb 2006 12:10:05 +1100
I would pick the second one simply because it does not require a
third party library. Which is quicker, I don't know is this a
situation where it really matters.
On 11/02/2006, at 11:07 PM, Koen van der Drift wrote:
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