 <p>The regex you can use is like this: </p> <pre><code>/SIP\/(\d+)@PBX/ </code></pre> <p>This finds:</p> <pre><code>text SIP followed by a / (which is escaped so it isn't interpreted as the end of the regex) followed by one or more digits (captured in a group delineated with parens) followed by the text @PBX </code></pre> <p>And, then you pull out the first matched group if there's a match.</p> <p>And, if you have nothing else to go on other than it's in a <code>&lt;td&gt;</code> in your page, then you can use this generic code that looks at all <code>&lt;td&gt;</code> elements in the page. Ideally, you would use the structure of the page to more clearly target the appropriate <code>&lt;td&gt;</code> cells.</p> <pre><code>var tds = document.getElementsByTagName("td"); var regex = /SIP\/(\d+)@PBX/; for (var i = 0; i &lt; tds.length; i++) { var matches = tds[i].innerHTML.match(regex); if (matches) { var number = parseInt(matches[1], 10); // process the number here } } </code></pre> <p>Working demo: <a href="http://jsfiddle.net/jfriend00/vDwfs/" rel="nofollow">http://jsfiddle.net/jfriend00/vDwfs/</a></p> <hr> <p>If the HTML is not in your page, but in a string, then you can just use the same regex to search for it in the HTML string. You could bracket it with <code>&lt;td&gt;</code> and <code>&lt;/td&gt;</code> if that seems wise based on your context.</p> <pre><code>var matches, number; var regex = /SIP\/(\d+)@PBX/g; while (matches = regex.exec(htmlString)) { number = parseInt(matches[1], 10); // process the number here } </code></pre>