I'm a complete RegEx newbie, with very little knowledge yet.
I need to extract text from in between the first two '-' from a string. For example:
"first-second-third-fourth" should return "second" (without all the quote marks)
I accomplished this by creating: (.*?)-(.*?)-(.*)
$2 then indeed gives the required output "second"
Where it get's to complicated for me is when there is only 1 "-" in the string.
I then want everything behind that "-" returned.
But with my current regex e.g. "first-second" will return "first-second", while I there also want to get "second".
With my current knowledge of regex this is miles above my head.
The solution would be much appreciated!