I wrote a regular expression (in Objective C) to find the following substrings in a string:
+RA, -RA, RA, +SN, -SN, SN, +DZ, -DZ, DZ
The original RE is:
NSString* expression = @"^.*?(RA|SN|DZ).*?$";
However, since .* implies practically anything, the RE also detects substring "DSNT", for instance, which I am trying to avoid. So instead of ^.*?, I am trying to write something like
But since the "+" sign has a special meaning in RE, it does not work as intended: the substrings are not identified. So, I wonder how to incorporate the "+" sign in the RE code above.