private
bool
CheckPhoneIsAble(
string
input)
{
if
(input.Length<11)
{
return
false
;
}
string
dianxin =
@"^1[3578][01379]\d{8}$"</code><code class="csharp plain">;</code></div><div class="line number9 index9 alt2"><code class="csharp plain">Regex regexDX = </code><code class="csharp keyword">new</code> <code class="csharp plain">Regex(dianxin);</code></div><div class="line number10 index10 alt1"><code class="csharp comments">//联通手机号码正则</code></div><div class="line number11 index11 alt2"><code class="csharp keyword">string</code> <code class="csharp plain">liantong = </code><code class="csharp string">@"^1[34578][01256]\d{8}"</code><code class="csharp plain">;</code></div><div class="line number12 index12 alt1"><code class="csharp plain">Regex regexLT = </code><code class="csharp keyword">new</code> <code class="csharp plain">Regex(dianxin);</code></div><div class="line number13 index13 alt2"><code class="csharp comments">//移动手机号码正则</code></div><div class="line number14 index14 alt1"><code class="csharp keyword">string</code> <code class="csharp plain">yidong = </code><code class="csharp string">@"^(1[012345678]\d{8}|1[345678][012356789]\d{8})$"
;
Regex regexYD =
new
Regex(dianxin);
if
(regexDX.IsMatch(input) || regexLT.IsMatch(input) || regexYD.IsMatch(input))
{
return
true
;
}
else
{
return
false
;
}
}