ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Regular Expression (Regex) for toll free number 1 800 ###-####<p>Please refer below code.</p> <p><span style="text-decoration: underline;">C#</span></p> <pre class="brush: csharp">if (System.Text.RegularExpressions.Regex.IsMatch(txtNumber.Text.Trim(), @&#34;^1[\s]?(800)?[\s\-]?\d{3}\-?\d{4}$&#34;)) { // this will be valid if phone is 1 800 333-4453 // this will be valid if phone is 1 800333-4453 // this will be valid if phone is 1800333-4453 // this will be valid if phone is 18003334453 // If you want mandatory space and hyphen in number then use below regex // &#34;^1[\s]?(800)[\s]\d{3}\-\d{4}$&#34; }</pre> <p><span style="text-decoration: underline;">VB</span></p> <pre class="brush: vb">If System.Text.RegularExpressions.Regex.IsMatch(txtNumber.Text.Trim(), &#34;^1[\s]?(800)?[\s\-]?\d{3}\-?\d{4}$&#34;) Then &#39; this will be valid if phone is 1 800 333-4453 &#39; this will be valid if phone is 1 800333-4453 &#39; this will be valid if phone is 1800333-4453 &#39; this will be valid if phone is 18003334453 &#39; If you want mandatory space and hyphen in number then use below regex &#39; &#34;^1[\s]?(800)[\s]\d{3}\-\d{4}$&#34; End If</pre> <p>I hope this will help you out.</p>https://www.aspforums.net:443/Threads/193093/Regular-Expression-Regex-for-toll-free-number-1-800--/https://www.aspforums.net:443/Threads/193093/Regular-Expression-Regex-for-toll-free-number-1-800--/Mon, 04 Jan 2016 04:29:07 GMT