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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -