How can I change the format of this input? : <p>I have this script in js:</p>

<p><strong>CODE HTML:</strong></p>

<pre><code>&lt;input class="required-input" type="text" name="date_of_birth" id="date_of_birth" placeholder="MM/DD/YYYY"&gt;
</code></pre>

<p><strong>CODE JS:</strong></p>

<pre><code>$('.required-input').each(function() {
             $(this).on('input keyup keypress blur change', function() {
        const dob=  /^([0]?[1-9]|[1|2][0-9]|[3][0|1])[./-]([0]?[1-9]|[1][0-2])[./-]([0-9]{4}|[0-9]{2})$/;
        var regex;

        if ($(this).attr("id") == "date_of_birth") 
            {
                 regex = dob;
            }

        //SOME CODE JS:

         });
     });
</code></pre>

<p>I want these things:</p>

<p>1.To be the next format  <code>23/09/1992</code></p>

<p>2.You can not write more characters than necessary.</p>

<p>3.You can not write letters, only numbers</p>

<p>How to change this variable <code>(dob)</code> to be good?</p>

<p>Thanks in advance!</p>
