02-24-2009 01:25 PM
Hi all,
Using the Match Regular Expression function I would like to match against only the nth occurrance of my regex in my input string. For the life of me I can't see how to do this neatly. I was hoping for a modifier followed by an argument (n) but I just can't figure it. I've been on a lot of the Perl sites and seen some examples but not being a high-level text-based programmer I can't seem to translate them to LabVIEW speak. Anyone got any ideas? Thanks in anticipation.
Regards, GGT.
Solved! Go to Solution.
02-24-2009 02:07 PM
Try this. (LabVIEW 8.2)
-Matt
02-24-2009 02:23 PM
So fuzzy wuzzy wasn't fuzzy was he? He may not be fuzzy but he's certainly ingenious! How simple, as all the best solutions are. Why didn't I think of that (rhetorical question). Well, if no one comes up with anything better you're on your way to one of those solutions thingys.
Regards, GGT.
02-24-2009 03:29 PM - edited 02-24-2009 03:35 PM
02-24-2009 04:01 PM
Wow! You guys are good. jcarmody, your's is the sort of solution I was groping in the dark for. Somehow I'd got it into my head that the solution might be linked with the modifier /g. Shows what I know about regexes. Without wanting to appear dimmer than I probably already do, you couldn't walk me through the rest of your regex, could you please? I'm starting to get to grips with regexes but I wouldn't have come to your solution in a month of Sundays.
Regards, GGT.
02-24-2009 05:15 PM
(?:.*?(z)){7}
But really, I found it here. http://www.perlmonks.org/?node_id=2150
You shouldn't feel dim. Nobody understands this stuff!
Jim
02-24-2009 06:07 PM
I forgot to ask.
Q - Why didn't little Jimmy understand Regular Expresions?
A - Because his mommy wouldn't let him play with matches!
02-25-2009 02:12 AM
"...wouldn't let him play with matches". Ha ha, very witty. Made me laugh. Thanks for your detailed reply and the link. Appreciated.
Regards, GGT.