christiangobo
christiangobo

Reputation: 530

Regex to match comma in string

I need a to match a comma in string, this is the example:

dog:Cat,hi:Bye,num:,1,2,3,5,6,7,8,9,10,this:that

Image

I want to match ONLY the comma with te green arrow using a regex or something

The value from "num:" always will be similar. example "num:,4,7,9" or "num:,2"

Thanks in advance

Upvotes: 5

Views: 17541

Answers (1)

mellamokb
mellamokb

Reputation: 56769

This should do it:

,(?=\w+:)

Upvotes: 8

Related Questions