First you need split each part (1,2,…)using split method and indexof() method after that apply regex to fetch value.