Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > RegExp help!

RegExp help!
Thread Tools
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 17, 2002, 02:57 PM
 
For quite sometime, I've been battling OomniFoundation and MOKit, trying in vain to get their regular expression tools to work properally. All I'm trying to do is take an NSString and parse out all the words and their NSRange within the NSString.

OFRegularExpression and OFRegularExpressionMatch work for about the first five words or so, but then starts complaining about rewind marks.

Here's essentially what I was doing:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
OFRegularExpression *exp=[[OFRegularExpression alloc] initWithString:<font color = orange>@"([<font color = blue>0</font>-9A-Za-z]+)"</font>];
OFRegularExpressionMatch *match = [exp matchInString:string];
while(<font color = blue>1</font>)
{
NSString* temp;
if(match==nil &#0124;&#0124; (temp=[match subexpressionAtIndex:<font color = blue>0</font>])==nil) break;
else
{
NSLog(temp);
match = [exp findNextMatch];
}
}
</font>[/code]

(I Apologize for any syntax errors; I just recreated everything after blowing away my old code to try something else). This doesn't work for very long. I can't even figure out the MOKit implementation... so can anyone help a poor guy out?

Thanks,
F-bacher
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
May 18, 2002, 02:38 PM
 
Hola... so, does this mean no one knows, no one cares, or than no one likes me? Just wondering, cause I'd like to have this working at some point.... *bump*

F-bacher
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:01 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2