Regular Expression Module re

Source: Internet
Author: User

  1. A regular expression matches some type of string by a specific formula. Match validation of strings or extract specific information from a large number of strings.
  2. Regular expressions contain ordinary characters and special characters. Most of the ordinary characters such as ' A ' or ' 0 ' can be simply matched to themselves. such as text can match ' text '. Special characters that can be used to match a set of strings, or to describe the use of characters.
  3. Feature characters include:
  4. . Matches any one character except \, such as CABCD in AB. can match ABC
  5. $ matches the end position of the string. (If the multiline property of the RegExp object is set, $ also matches the position before "\ n"), such as fol matching folked in 123folked, and fol$ matching fol
  6. ^ matches the starting position of the string (if the multiline property of the RegExp object is set, ^ can also match the position after "\ n")
  7. * Match 0 or more of the preceding sub-expressions, for example: ab* match A,ab or a after a successor to the B
  8. + match 1 or more of the preceding sub-, for example ab+ match A is greater than 0 B, so it cannot match only a
  9. ? Match 0 or 1 times in front of the sub, such as AB? Match A or AB
  10. *?,*?,?? is greedy, maximizing the match, for example, to match the
  11. {m} matches the string after the child repeats m times. For example: a{3} matches AAA, but cannot match other times a.
  12. {M,n} matches an M to n-th preceding subtype. A{3,}b matches the Aaab, or matches 100 times a one B.
  13. {m,n}? match minimized mode, a{3,5}b to Aaaaaab, match to Aaab.

Regular Expression Module re

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.