I have these two strings:
I would like to have a regex that would match only the first occurrence of the hyphen in both strings, such that the split would then be:
[1,-2]. How would I achieve this, since I have been wracking my brain for too long on this now?
EDIT: The two strings can also occur in the same string such that:
"1-2-1--2". Therefore a single regular expression covering both cases would be in order.