Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

BollywooD

macrumors 6502
Original poster
Apr 27, 2005
372
46
Hamburg
I can't quite get me head around the regex syntax.
I am trying to loop through a string, removing all specified objects after a "$" symbol, ie:

Code:
str = [str stringByMatching:@"\\$(\\~object_subresource| script|,)\\{0,3\\}" replace:RKReplaceAll withReferenceString:@""];

is there a regex syntax for and/or? in the case of the "$" symbol above, it will match (and remove):

blahblah$~object_subresource
blahblah$script

but not:

blahblah$~object_subresource,script


**note: I am using the RegexKit Framework for the matching
 
In terms of a regex just for those matches and ignoring the other,
Code:
^.*\$([\w~]+)$
will do it.

I'm not familiar with the code syntax you're using (Objective-C?) so I won't try to incorporate this regex into it as I'd likely screw it up.
 
In terms of a regex just for those matches and ignoring the other,
Code:
^.*\$([\w~]+)$
will do it.

I'm not familiar with the code syntax you're using (Objective-C?) so I won't try to incorporate this regex into it as I'd likely screw it up.

many thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.