Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Sorry to say this, but none of your regexes are going to work. Remember that regular expressions are designed to match textual data. While it's possible to use them to match numbers, it's not really the tool of choice.</p> <p>If you <em>have</em> to use a regex, you need to think of the possible <em>textual</em> representations of a number range. </p> <p>For your <strong>example 1</strong>, that would be:</p> <ol> <li>either a single digit</li> <li>or a digit between 1 and 3, followed by any digit</li> <li>or a 4, followed by a digit between 0 and 5.</li> </ol> <p>As a regex:</p> <pre><code>^(?:\d|[1-3]\d|4[0-5])$ </code></pre> <p>The <code>^</code> and <code>$</code> anchors make sure that the entire string is evaluated; the <code>(?:...)</code> groups the alternation and "shields" it from the anchors.</p> <p>For your <strong>example 3</strong>:</p> <ol> <li>either a 1, followed by 6-9</li> <li>or a 2-5, followed by any digit</li> <li>or a 6, followed by 0-5</li> </ol> <p>As a regex:</p> <pre><code>^(?:1[6-9]|[2-5]\d|6[0-5])$ </code></pre> <p>For your <strong>example 5</strong>:</p> <ol> <li>1-5 digits</li> <li>or a 1, followed by 0-4, followed by any four digits</li> <li>or 150000.</li> </ol> <p>As a regex:</p> <pre><code>^(?:\d{1,5}|1[0-4]\d{4}|150000)$ </code></pre> <p>And so on. </p> <p>Adding decimal places is not very difficult:</p> <ul> <li><code>\.\d{2}</code> works for exactly two decimal places</li> <li><code>\.\d{1,3}</code> for 1 to 3 decimal places</li> <li>and <code>(?:\.\d{1,2})</code> for 0 to 2 decimal places (and the dot is only allowed if at least one digit follows).</li> </ul>
    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