Common methods in the development of Android regular expression

Source: Internet
Author: User
simple documentation of regular expressions commonly used during development: 1.[a-b] is a number or letter from a- b 2.a.b represents ending with a beginning to B. Only one character can be represented. For example, Acb,adb,aab,a#b,a B and other 3.a[abcde]b only the words specified in the square brackets characters participate in matching, can only match a single character 4. If you want to get aoob, you need to use |. | The basic meaning of an operator is a "or" operation. to match "Toon", use the "t (A|e|i|o|oo) n" Regular expression. You cannot use a square extension, because the square brackets allow only a single character to be matched, and the parentheses "()" must be used here. Parentheses can also be used to group 5. If you want to express starting with a string, you need to add (. *) after the given string. For example, the string that needs to be matched is: "sp0\\d\\* (. *)", which means matching any string that begins with the sp04 (which can be any number of 0-9) *.

Common methods in the development of Android regular expression

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.