Here is a regex pattern I created in Objective C:
^\n?([#]{1,2}$|[*]{1,2}$|[0-9]{1,3}.$)
I want to match:
- starts with \n or empty
- ends with # or * or .
- if ends with . there will be 1 or 2 or 3 digits in between
- If ends with # or *, there could be 1 more # or * in between
The regex I created matches '\n1#' which is not what I want. Can anyone help me correct this? Is this fastest one? The regex will be used frequently, so I want it to be as fast as possible.
UPDATE:
Here's a sample strings for testing:
"\n#", "11*1", "1#", "a1.", "111*", "\n1#", "\n11.", "a11.", "1. ", "*1."
The 1# and 111* were matched. Not sure what went wrong.