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

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

How to connect android app to App engine -

hadoop - Running Map Reduce Job shows error - Mkdirs failed to create /var/folders/ -