0

I need a PCRE compatible regex to capture My-Test & 12345 from this string:

"My-Test:abc,def,ghi,jkl:12345"

Here is what I have got so far:

/(?<=:)(.*)(?=:)/g

https://regex101.com/r/xKgh7j/1 I need the other parts of the entire line. My-Test is before the first colon. 12345 will always come after second (or last) colon.

1 Answer 1

1

Try this one ^([^:]+):[^:]+:(.*)$

https://regex101.com/r/Ebkzjb/1

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.