javascript - Matching the character but not including that character and everything after -


before says it's duplicate of this or this. javascript doesn't have look behind i've been struggling this. have look ahead mentioned here

what want this. have :-
hey:blah,{'some':'obj','another':[4,5,0]}

i want extract after not including first :. output be:-
blah,{'some':'obj','another':[4,5,0]}

my attempt far:-
(:.+) //gives :blah,{'some':'obj','another':[4,5,0]} - note has :
[^\w:].+ //gives ,{'some':'obj','another':[4,5,0]} - not result expected. blah missing.

i'm trying in pure regex , trying avoid looping or string manipulation of sort.
attempt has been no avail far.

^[^:]*:(.*$) 

you can try this.grab group 1 .see demo.

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


Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -