AGRegex question
AGRegex question
- Subject: AGRegex question
- From: Koen van der Drift <email@hidden>
- Date: Thu, 9 Feb 2006 21:20:41 -0500
Hi,
I am using the AGRegex framework to implement a bunch of perl regular
expressions in my code to parse a specific text file. AGRegex uses
pcre, so if I understand correctly, a perl regex should be able to be
used.
I started with a relatively simple regex to determine whether a
string only contains whitespace and the word 'foo' on a line. Here's
what I have now:
AGRegex *regex = [AGRegex regexWithPattern: @"/^\s*foo\s*$/"];
AGRegexMatch *regexMatch = [regex findInString: currentLine];
When I built the code, I got a warning: unknown escape sequence '\s'.
I solved that by escaping \s as follows:
AGRegex *regex = [AGRegex regexWithPattern: @"/^\\s*foo\\s*$/"];
The warning indeed went away. But when I debug the code, regexMatch
always returns NO, even when the code encounters a line that only
contains foo.
Any idea what I might be doing wrong?
thanks,
- 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