pato.llaguno
pato.llaguno

Reputation: 741

Implementing regex in comma separated numbers

i am a total noob into regex expressions.

i have something like this coming from a serial input.

6,0,0,0,0,0,259,2508,20,169
55,0,0,0,61,0,259,2508,20,169
91,0,0,0,60,0,259,2508,20,169
126,0,0,0,60,0,259,2508,20,169
162,0,0,0,60,0,259,2508,20,169
198,0,0,0,61,0,259,2508,20,169

i want to match each line to see if there is 10 numbers separated by a comma each, i believe the end of the line is checked by \r\nA but i don't really understand much of regex, if someone know the answer can i have some explanation on what does it mean? Thanks!

Upvotes: 2

Views: 82

Answers (2)

Yaalie
Yaalie

Reputation: 108

try this. It will match lines that have more than 10 digits long.

(\d{1,},?){10,}+

Check the regex here.

Upvotes: 1

anubhava
anubhava

Reputation: 785196

You can use this regex:

^\d+(,\d+){9}$

RegEx Demo

Upvotes: 2

Related Questions