 <p><strong>Assuming a dash following a space or vice versa is ok:</strong></p> <pre><code>^( -?|- ?)?(\d( -?|- ?)?){9,13}$ </code></pre> <p><strong>Explanation:</strong></p> <p><code>( -?|- ?)</code> - this is equivalent to <code>( | -|-|- )</code>. Note that there can't be 2 consecutive dashes or spaces here, and this can only appear at the start or directly after a digit, so this prevents 2 consecutive dashes or spaces in the string.</p> <p>And there clearly must be exactly one digit in <code>(\d( -?|- ?)?)</code>, thus the <code>{9,13}</code> enforces 9-13 digits.</p> <p><strong>Assuming a dash following a space or vice versa is NOT ok:</strong></p> <pre><code>^[ -]?(\d[ -]?){9,13}$ </code></pre> <p>Explanation similar to the above.</p> <p>Both of the above allows the string to start or end with a digit, dash or space.</p>