User Tools

Site Tools


regex:numbers:floating-point

Differences

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

Link to this comparison view

Next revision
Previous revision
regex:numbers:floating-point [2022/09/20 23:03] – created peterregex:numbers:floating-point [2022/09/20 23:05] (current) peter
Line 1: Line 1:
 ====== Regex - Numbers - Floating-point ====== ====== Regex - Numbers - Floating-point ======
  
-[[Regex:Numbers:Floating-point|Floating-point]]+===== Floating-point ===== 
 + 
 +<code> 
 +^-?([1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0)$ 
 +</code> 
 + 
 +---- 
 + 
 +===== Positive floating-point ===== 
 + 
 +<code> 
 +^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$ 
 +</code> 
 + 
 +or 
 + 
 +<code> 
 +^[1-9]\d*\.\d*|0\.\d*[1-9]\d*|0?\.0+|0$ 
 +</code> 
 + 
 +---- 
 + 
 +===== Negative floating-point ===== 
 + 
 +<code> 
 +^((-\d+(\.\d+)?)|(0+(\.0+)?))$ 
 +</code> 
 + 
 +or 
 + 
 +<code> 
 +^-([1-9]\d*\.\d*|0\.\d*[1-9]\d*)$ 
 +</code> 
 + 
 +or 
 + 
 +<code> 
 +^(-([1-9]\d*\.\d*|0\.\d*[1-9]\d*))|0?\.0+|0$ 
 +</code> 
 + 
 +or 
 + 
 +<code> 
 +^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$ 
 +</code>
  
 ---- ----
  
regex/numbers/floating-point.1663715019.txt.gz · Last modified: 2022/09/20 23:03 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki