Regular expression

xiaoxiao2021-04-08  449

Regular expression is a mode in combination with text description characters. Use them in code search help to describe some concepts, such as "rows starting with 'VAR'" and "Intributes of numbers". For more information on search, see Search and Replace Tags and properties.

The following table lists the special characters used in the regular expression, its meaning and usage examples. To search for text containing a particular character in the table, add a backslash in front of the special character to "escape". For example, if you want to search the actual asterisk in a Some Conditions Apply * phrase, your search mode should be similar to: apply / *. If you don't make an asterisk escape, you will find all matching items of "Apply", "ApplyY", "Applyy", "ApplyY", not just those who follow the asterisk. .

Character matching example ^ Enter the starting section of the row. ^ T Match "T" in "THIS Good Earth", but does not match "T" in "Uncle Tom's Cabin". The end of the input or row. H $ matches "H" in "TEACH", but does not match "H" * 0 or more preamble in "TEACHER". Um * Match "UM", "UMM" in "UMM" in "UMM" in "Rum" and "U" 1 or more preamble characters in "huge". UM matches "UM" and "Yummy" in "Rum", but there is no match in "huge"? The front character appears once (ie, indicating the front character is optional). ST? ON matches "SON" and "Johnston" in "Johnson", but there is no match in "Appleton" and "Tension". In addition to any single characters outside the line. "RAN" and "CAN" X | Y X or Y in the phrase "BRAN MUFFINS CAN Be Tasty". FF0000 | 0000FF Matches "0000FF" {n} in "FF0000" and Font Color = "# 0000FF" in BGColor = "# ff0000" just n pre-character. O {2} Match the first two "o" in "oo" in "LOOM", but there is no match {n, m} in "Money" at least n, at most M preamp character. F {2, 4} Match "# ff0000" in "FF" and "#ffffff" in "#ffffff" in "#ffffffffffffffffffffffffffffffffff) any of the characters enclosed in parentheses. Specify a range of characters (for example, [A-F] equivalent to [ABCDEF]) with a hyphen. [E-G] "g" [g "[g" [ABC] in "F" in "Fol" in "BED" is matched, "g" [ABC] in parentheses is not enclosed in parentheses. Specify a range of characters (for example, [^ A-F] equivalent to [^ Abcdef]) with a hyphen. [^ Aeiou] The "K" / B word boundary (such as space or auto-return "in" B "and" EEK! "In" R "," Book "in" ORANGE "is initially matched. / BB matches "B" in "BOOK", but there is no content other than any match / B word boundary in "GoOBer" and "Snob". / BB matches "B" in "GOOBER", but there is no match / d any numeric character in "Book". Equivalent to [0-9]. / D Match "2" / D any non-numeric character in "3" and "Apartment 2G" in "C3PO". Equivalent to [^ 0-9]. / D Match "Q" / F page of "Q" and "Q45" in "900S". / N wrap. / R Enter. / S Any single blank character, including spaces, tabs, change, or newline characters. / Sbook matches "BOOK" in "Blue Book", but there is no match / s any single non-blank character in "Notebook". / Sbook matches "Book" in "Notebook", but there is no match / t tatter in "Blue Book". / W Any alphanumeric character, including underscore. Equivalent to [A-ZA-Z0-9_]. B / W * Match "Barking" in "The Barking Dog" and "Big" and "Black" / W any non-alphanumeric characters in "The Big Black Dog". Isometrically equivalent to [^ A-ZA-Z0-9_].

/ W Match "&" and "100%" in "Jake & Mattie" in "100%" Control ENTER or SHIFT ENTER (Windows), or Control Return or Shift Return or Command return (Macintosh) Enter. Make sure if no regular expressions are used, cancel the selection of "ignoring blank difference" at the time of search. Note that this matches a particular character, not a newline in a general sense; for example, it does not match the
tag or

tag. The Enter is displayed in the "Design" view as space instead of a newline. The packets to be referenced later in the regular expression in the regular expression. Then use $ 1, $ 2, $ 3, etc. in the "Replace" domain, reference the first, second, third, and more brackets.

Note: Use / 1, / 2, / 3, etc. (rather than $ 1, $ 2, $ 3) in the "Find Content" text box to reference your earlier brackets in the regular expression.

For example, by searching (/ D ) // (/ d ) // (/ d ) and replaced it with $ 2 / $ 1 / $ 3, it can exchange days and months in the date separated by the slash (therefore can be in the US style date and Convert between European style dates).

转载请注明原文地址:https://www.9cbs.com/read-132748.html

New Post(0)