Regexing help in python
<p>I am wondering if there is an efficient way to check if a number is in the format 1_2_3_4_5_6_7_8_9_0 , where the '_' is a number. 
For Example,</p>

<p><strong>1</strong>9<strong>2</strong>9<strong>3</strong>7<strong>4</strong>2<strong>5</strong>4<strong>6</strong>2<strong>7</strong>4<strong>8</strong>8<strong>9</strong>0<strong>0</strong></p>

<p>My initial though was string indexing, but I quickly discovered that it was too slow. Is there a better way using regexing in python? </p>

<p>Thanks in advance, 
                Arvind</p>

<blockquote>
  <p>My initial thought was string indexing, but I quickly discovered that
  it was too slow</p>
</blockquote>

<p>Most possibly you are not using the right approach</p>

<p>You can always use regex but, string indexing with strides can have better performance than using regex</p>

<pre><code>st = "1929374254627488900"
st[::2] == "1234567890"
Out[93]: True
</code></pre>

python regex string