Friday 15 January 2010

regex - reg expression of number of duplicated numbers -



regex - reg expression of number of duplicated numbers -

this question has reply here:

split regex extract strings of contiguous characters 1 reply

i have next question need reg expert help. have string "11122233344456", need set same digits string. above example, shall "111","222","333","444","5","6".

another example: "223334456111", shall "22","333","44","5","6","111".

would regex expert help me find solution?

you can utilize regex:

((\d)\2*)

and grab captured grouping #1

regex demo

regex

No comments:

Post a Comment