Answer 1: How to get value between 4th and 5th colons:

(?>[^:]+:){4}([^:]+)

Try at regex101

Answer 2: How to get value after the 6th colon:

(?>[^:]+:){6}([^:]+)

Try at regex101

Note: You can replace + with * to handle cases like ::::2: (empty between colons).

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top