RegEx checks the validity of input information in. net.

Source: Internet
Author: User

Use. Net's RegEx to determine the legality of the input information. Let's take a look at the following example:

RegEx. ismatch ("username", @ "[a-zA-Z0-9] [a-zA-Z0-9 _] {} [a-zA-Z0-9]")

This is to determine the validity of an input user name. The length of the user name is 2-29 characters.

True is returned if it is valid. False is returned if it is invalid.

The following regular expression is determined according to your requirements.

Reference using system. Text. regularexpressions before use;

You can also write a class. I will not give an example here.

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.