Hi,
I am not sure what the (?i) at the beginning or (?-i) at the end are supposed to be doing in your Regex... when I used this in an online regex tester, those both came back as invalid.
However, using the string
"Trending Articles 123:Link:Emerging Issues Executive Quarterly: Insurance in the Inflationary Era:"
with this regex:
^(.*?):(.*?):(.*):(.*)$
results in:
- $0 - Trending Articles 123:Link:Emerging Issues Executive Quarterly: Insurance in the Inflationary Era:
- $1 - Trending Articles 123
- $2 - Link
- $3 - Emerging Issues Executive Quarterly: Insurance in the Inflationary Era
- $4 - ""
Basically, (.*?) in the regex means "match any character except line breaks" / "match 0 or more characters" / "lazy qualifier - match as little as possible"
Which in your original regex (minus the odd things), meant that the first instance of colon in your string would force the extracted group to stop...
But on the next part (Link), it wasn't using the lazy designation... and because you actually had 1 too many colons in the text, this group took on the extra values.... I just made the second group also lazy, so that the break would occur after "Link", but the next part (the article title with the extra characters) should now take on ALL extra colons until the last one in the string, which will then be your part 4.
I hope this helps