i am relatively new to NSRegularExpression and just can’t come up with a pattern to find a string within a string….
here is the string…
#@$294@001@[12345-678[123-456-7@15665@2
I want to extract the string..
@001@[12345-678[123-456-7@
for more info I know that there will be 3 digits(like 001) between two @ ‘s and 20 characters between the last two @ ‘s..
I have tried n number of combinations but nothing seem to work. any help is appreciated.
How about something like this:
If you know that the 20 characters will always consist of digits,
[and-, your pattern would become:Be careful with the backslashes: When you use create the pattern with a string literal (
@"..."), you need to add an extra backslash before each backslash.