Hello,
You can do this by string MobileRegex = @"^05\d{8}$";
.
^
matches the beginning of the string.
05
will be a simple and plain exact match.
\d
will match any digit.
{8}
will repeat the previous expression (\d in this case) exactly 8 times.
$
matches the end of the string.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.