User Tools

Site Tools


regex:numbers

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
regex:numbers [2022/09/20 23:09] peterregex:numbers [2022/09/20 23:13] (current) peter
Line 6: Line 6:
  
 [[Regex:Numbers:Floating-point|Floating-point]] [[Regex:Numbers:Floating-point|Floating-point]]
 +
 +[[Regex:Numbers:Integers|Integers]]
  
 [[Regex:Numbers:Numbers only|Numbers only]] [[Regex:Numbers:Numbers only|Numbers only]]
Line 18: Line 20:
 ---- ----
  
-Numbers not begin with 0 and maximum 2 decimals 
- 
-<code> 
-^([1-9][0-9]*)+(.[0-9]{1,2})?$ 
-</code> 
- 
----- 
- 
-Positive or Negative numbers with maximum 2 decimals 
- 
-<code> 
-^(\-)?\d+(\.\d{1,2})?$ 
-</code> 
- 
----- 
- 
-Positive, Negative numbers and any decimal length 
- 
-<code> 
-^(\-|\+)?\d+(\.\d+)?$ 
-</code> 
- 
----- 
- 
-Numbers with maximum 2 decimals 
- 
-<code> 
-^[0-9]+(.[0-9]{2})?$ 
-</code> 
- 
----- 
- 
-Numbers with 1-5 decimals 
- 
-<code> 
-^[0-9]+(.[0-9]{1,5})?$ 
-</code> 
- 
----- 
- 
-Positive Integer, excluding 0 
- 
-<code> 
-^[1-9]\d*$ 
-</code> 
- 
-or 
- 
-<code> 
-^([1-9][0-9]*){1,3}$ 
-</code> 
- 
-or 
- 
-<code> 
-^\+?[1-9][0-9]*$ 
-</code> 
- 
----- 
- 
-Negative Integer, excluding 0 
- 
-<code> 
-^-[1-9]\d*$ 
-</code> 
- 
-or 
- 
-<code> 
-^\-[1-9][0-9]*$ 
-</code> 
- 
----- 
- 
-Positive Integer 
- 
-<code> 
-^\d+$ 
-</code> 
- 
-or 
- 
-<code> 
-^[1-9]\d*|0$ 
-</code> 
- 
----- 
- 
-Negative Integer 
- 
-<code> 
-^-[1-9]\d*|0$ 
-</code> 
- 
-or 
- 
-<code> 
-^((-\d+)|(0+))$ 
-</code> 
- 
----- 
  
  
regex/numbers.1663715369.txt.gz · Last modified: 2022/09/20 23:09 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki