Any number between 0 and 10 with 0 or 1 decimal places

Published on Tue Mar 01 2022

Matches any number between 0 and 10 (inclusive) with 0 or 1 decimal places. Note that .5 will NOT be matched but 0.5 will. Also 10.X will not be matched, but 10 will.

Additional matching regexes for
Any number between 0 and 10 with 0 or 1 decimal places

Any number between 0 and 10 with 0 or 1 decimal places

Matches any number between 0 and 10 (inclusive) with 0 or 1 decimal places. Note that .5 will NOT be matched but 0.5 will. Also 10.X will not be matched, but 10 will.

Numeric values greater than zero with decimal

Pattern that only accept numeric value and greater than zero with up to decimal places( you can change the decimal places just replace {1,2} depend on how many decimal places you like

Matching decimals in european format (dot as grouping separator, comma as decimal separator)

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.

Simple Number

Verifies Number is a negative/positive number. Number may be a decimal, but if it is, it requires at least one number before and after the decimal place. Decimal numbers may also be negative or positive. Only 1 decimal place is allowed.

Number 0-100, 2 decimals

A number between 0 and 100 (including them) with up to two decimals. The decimal separator can be . or , . Usefull for percentage.

Test numeric input to be between 0,01 and 100,00

Tests a numeric input to be between 0,00 < input <= 100,00. Decimals are optional but have at max 2 places.

Decimal (with dot)

Decimal with a dot, if has a dot it needs a number following it

Extract elevation from GPX

Matches everything except content between <ele> and </ele>

Domain from URL

Matches everything before after // or www and before a period. If needed, replace the matched elements with blanks.

html color match: transparent, #fff, #123456, rgb, rgba, hsl, hsla

This may be useful or not to test whether a given string is a valid (more or less) html color value. It matches color values such as: - #123 - short hex color value - #123456 - hex color value - rgb(255,255,0) - rgb color value - rgba(255,255,0,1.0) - rgba color value - hsl(360,100%,100%) - hsl color value - hsla(360,100%,100%,0.5334) - hsla color value Regex allows whitespaces between i.e. rgb and (, also between numbers and commas, but not in value like 55% between number and percentage. To change this behaviour simply remove \s*? from appriopriate places.