1,00 – 365,99
\b([1-9]|[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-5]),[0-9][0-9]\b
Explanation:
\b
: This matches a word boundary, ensuring that the input will not match substrings such as "The number 12345,6789 should not be considered to contain a valid match."
[0-9]
: This matches any digit between 0
and 9
. Similarly, [0-5]
matches any digit between 0
and 5
. [12]
(without a dash) matches either the digit 1
or the digit 2
.
|
: This delimits possible subexpressions, any one of which would be a valid match. The above regular expression uses the following subexpressions to match against the full range of numerical values represented by the input:
[1-9]
: values less than 10
[1-9][0-9]
: values between 10
and 99
[12][0-9][0-9]
: values between 100
and 299
3[0-5][0-9]
: values between 300
and 359
36[0-5]
: values between 360
and 365
,[0-9][0-9]
: Finally, this matches a literal comma followed by any two digits.
1,00 – 365,00
\b(([1-9]|[1-9][0-9]|[12][0-9][0-9]|3[0-5][0-9]|36[0-4]),[0-9][0-9]|365,00)\b
This uses the previous regular expression adapted to match numeric strings representing values between 1,00
and 364,99
, to which 365,00
is appended as a final valid possible match.