<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [iOS] input pattern=&quot;[0-9.]*&quot; should use DecimalPad keyboard"
   href="https://bugs.webkit.org/show_bug.cgi?id=161506#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [iOS] input pattern=&quot;[0-9.]*&quot; should use DecimalPad keyboard"
   href="https://bugs.webkit.org/show_bug.cgi?id=161506">bug 161506</a>
              from <span class="vcard"><a class="email" href="mailto:dvpdiner2&#64;gmail.com" title="Darryl Pogue &lt;dvpdiner2&#64;gmail.com&gt;"> <span class="fn">Darryl Pogue</span></a>
</span></b>
        <pre>I agree the regex isn't an ideal solution. I was trying to brainstorm something more flexible than string comparisons though, and this was the best I came up with.

One complaint of the current string comparison whitelisting is that it makes it hard for people to use the pattern attribute for actual validations. If you want to collect a 5-digit number, the best pattern would be &quot;\d{5}&quot;, but that causes iOS to opt-out of the number pad keyboard because it doesn't match the whitelist.


It's not obvious what the string comparison should be for a decimal pad, since the naïve &quot;[0-9\.]*&quot; would actually allow multiple decimal points to validate. Suggested patterns from online resources include &quot;\d*\.\d*&quot; or &quot;[0-9]*\.[0-9]*&quot;, but both of those make the decimal point required.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>