Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Java 8

"
^\d{1,3}(?:\.\d{3})*(?:,\d+)?$|^\d+(?:,)?\d+$
"
gm

Description

A regex for validating decimal numbers in the European number format (in many parts of Europe at least, including Germany). A comma is used as a separator for the decimal number, a dot as a separator for thousand places.

Submitted by Florian Drees - 4 years ago (Last modified 4 years ago)