Matches a regular expression _ regular expression of 5 to 10 digits without repeating numbers

Source: Internet
Author: User
Regular with duplicate 5 to 10 digits can be used with \d{5,10}

No duplicates 5 to 10 digits I thought about it, but I had to check the Internet.

There is a good version, anyway Regexbuddy test passed.

Copy Code code as follows:
^(?! \d*? (\d) \d*?\1) \d{5,10}$


For (?! ......... (......) ... \1) This form I have not studied thoroughly, have the time I really want to study carefully.

Previous example of PHP:

Copy Code code as follows:

<?php
$str = ' 123456789 ';
$search = '/^ (?! \d*? (\d) \d*?\1) \d{5,10}$/';
$result = Preg_match ($search, $STR);

Echo ' matches no repetition of 5 to 10 digits <br/> ';
if ($result >0) {
Echo ' fits ';
}else {
Echo ' does not conform ';
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.