elkebirmed
elkebirmed

Reputation: 2357

Match numbers without dot at the start

This RegEXP match a number with decimal separator:

(?=\D?)([1-9][0-9]{1,2})\.(\d+)(?=\D?)

I want it exclude this one cuz it has a dot at the start.

.999.00

Upvotes: 1

Views: 39

Answers (1)

anubhava
anubhava

Reputation: 784998

You can try this regex:

/(?:^|[^.])\b([1-9][0-9]{1,2})\.(\d+)\b/gm

RegEx Demo

(?:^|[^.]) will match either line start or any character other than DOT before your number.

Upvotes: 1

Related Questions