Regular expression format for the Find command

Source: Internet
Author: User

Use the etags of Emacs to generate TAGS, to find all the. h and. CPP tried for half a day, and finally found the GNU to understand the regular format of find

Please attach the GNU find's reference address: The default regular expression format for GUN find

A brief description of the format is as follows:

    • ' + '? ' \+ ': Same as regular expressions in other languages
    • The characters within [] are not escaped, type references are not supported, but support ranges, such as [0-9] are correct, but cannot be replaced with [[:d Igit:]], such as [\a] means \ and a
    • Supported extensions include: \w \w \> \< \b \b \ ' \ '

Here are some of the more special or noteworthy places to look at:

    • The group uses the \ (and \), which seems to be not the same as the others, the general is the use of ()
    • or with \| said, similar to the above, as if it is not the same as the other, the general is to use yes |
    • Except for the following position, ^ there is no special meaning
      • The beginning of a regular expression
      • In the grouping identifier \ (after
      • In or identifier \| After
    • In addition to the following position, $ has no special meaning
      • At the end of the regular expression
      • In the grouping identifier \ (after
      • In or identifier \| After
    • Except in the following position, ' * ' + '? ' is always a special character
      • The beginning of a regular expression
      • In the grouping identifier \ (after
      • In or identifier \| After

By default, greedy mode is used, which is to return the match as long as possible.

Regular expression format for the Find command

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.