Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A digit in the range 1-9 followed by zero or more other digits:</p> <pre><code>^[1-9]\d*$ </code></pre> <p>To allow numbers with an optional decimal point followed by digits. A digit in the range 1-9 followed by zero or more other digits then optionally followed by a decimal point followed by at least 1 digit:</p> <pre><code>^[1-9]\d*(\.\d+)?$ </code></pre> <p><strong>Notes:</strong></p> <ul> <li><p>The <code>^</code> and <code>$</code> anchor to the start and end basically saying that the whole string must match the pattern</p></li> <li><p><code>()?</code> matches 0 or 1 of the whole thing between the brackets</p></li> </ul> <p><strong>Update to handle commas:</strong></p> <p>In regular expressions <code>.</code> has a special meaning - match any single character. To match literally a <code>.</code> in a string you need to <em>escape</em> the <code>.</code> using <code>\.</code> This is the meaning of the <code>\.</code> in the regexp above. So if you want to use comma instead the pattern is simply:</p> <pre><code>^[1-9]\d*(,\d+)?$ </code></pre> <p><strong>Further update to handle commas and full stops</strong></p> <p>If you want to allow a <strong>.</strong> between groups of digits and a <strong>,</strong> between the integral and the fractional parts then try:</p> <pre><code>^[1-9]\d{0,2}(\.\d{3})*(,\d+)?$ </code></pre> <p>i.e. this is a digit in the range 1-9 followed by up to 2 other digits then zero or more groups of a full stop followed by 3 digits then optionally your comma and digits as before.</p> <p>If you want to allow a <strong>.</strong> anywhere between the digits then try:</p> <pre><code>^[1-9][\.\d]*(,\d+)?$ </code></pre> <p>i.e. a digit 1-9 followed by zero or more digits or full stops optionally followed by a comma and one or more digits.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload