dimanche 5 juillet 2015

regex pattern is matching with one of the pattern i cant able to follow?

I just come across a regex pattern and its matching pattern strings, but i am confused about one of the matched pattern

Target: .50 1.50 0.50 10.50 00.50 1.555

Pattern: (0|[1-9]\d*)\.\d\d

Matches with: (4,7:1.50)(9,12:0.50)(14,18:10.50)(21,24:0.50)(26,29:1.55)

What i deduce from the pattern is two digit after decimal, and before decimal a group in which first digit is either 0 or any digit between 1 to 9, followed by empty string or any number string...

I think in last second match it should be 00.50.

What am i missing??

Aucun commentaire:

Enregistrer un commentaire