• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Regexp with MOKit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Regexp with MOKit


  • Subject: Regexp with MOKit
  • From: Sam Goldman <email@hidden>
  • Date: Mon, 04 Mar 2002 21:43:00 -0800

I am using MOKit for regular expressions, which I understand minimally at
the moment, and I am having a problem. What I want it to do is find all the
xml tags in an NSString. I am using "<[^>]*>" (without quotes) for the
expression. If you are familiar with MOKit, you will understand this. I
don't know about others, but y'all seem pretty smart.

The header states this after the method I am using:

- (NSRange)rangeForSubexpressionAtIndex:(unsigned)index inString:(NSString
*)candidate;
// Range of subexpression match. Returns {NSNotFound, 0} if there was
no subexpression for that index.

I get a NSRange with this line of code:

NSRange theRange = [xmlRegExp rangeForSubexpressionAtIndex:i
inString:theString];

And test to to see if the NSRange I get is equal to NSNotFound, but (as I
expected), the two types are incompatable and on compile I get this error:

invalid operands to binary !=

Is this the actual behavior or do I misunderstand?

Thanks,
Sam

--
Windows is a 32-bit patch to a 16-bit shell for an 8-bit operating system
written for a 4-bit processor by a 2-bit company without 1 bit of sense.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Regexp with MOKit
      • From: Sam Goldman <email@hidden>
  • Prev by Date: Re: "Where to go from here?" 2
  • Next by Date: Re: Regexp with MOKit
  • Previous by thread: Re: "Where to go from here?" 2
  • Next by thread: Re: Regexp with MOKit
  • Index(es):
    • Date
    • Thread