I've got a situation where I need to enumerate through all subexpression patterns, and I keep hitting brick walls on this one. I'd like to enumerate through all the capture subpatterns in a given RKRegex class (i.e. a method that would be probably be named -capturesArray). I've been trying to dig through the code for several hours to piece together how to write such a method, but I can't seem to make heads or tails of it.
Any pointers as to what class/instance methods I could use, or the C function to make this happen? I've tried digging through the different C functions that form the guts of RegexKit.framework, but because my low-level knowledge of C isn't so hot, I really have no idea where to start here.
TIA!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Alright... I spoke too soon. My original request stands:
I need a way to iterate through all the *capture subpatterns* in the regex, not the *captured subpatterns*. (potential, not actual). If anyone has any code ideas for this, it would be really great.
-S
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've got a situation where I need to enumerate through all subexpression patterns, and I keep hitting brick walls on this one. I'd like to enumerate through all the capture subpatterns in a given RKRegex class (i.e. a method that would be probably be named -capturesArray). I've been trying to dig through the code for several hours to piece together how to write such a method, but I can't seem to make heads or tails of it.
Any pointers as to what class/instance methods I could use, or the C function to make this happen? I've tried digging through the different C functions that form the guts of RegexKit.framework, but because my low-level knowledge of C isn't so hot, I really have no idea where to start here.
TIA!
Never mind. I found the answer here:
http://www.cocoadev.com/index.pl?RegexKit
Truly a very smart developer, that John man is.
-S
Alright... I spoke too soon. My original request stands:
I need a way to iterate through all the *capture subpatterns* in the regex, not the *captured subpatterns*. (potential, not actual). If anyone has any code ideas for this, it would be really great.
-S