Matches platform-independent line breaks. In the replacement expression, insert a line break. Any character [] in the collection matches any character in []. To specify a range of characters, list the starting and ending characters separated by dashes (-), for example, [a-z]. Any character [...] that is not in the set matches any character that is not after it in the set. Or | matches any expression on either side of the or sign (|). Often used in groups. For example, a (sponge | mud) bath can be paired with a "sponge bath" and a "mud bath". Escape\ Matches the characters after the backslash (\) as text. This expression allows you to search for symbols used in regular expression tags, such as {and. For example, \ can be used to find characters. The tag expression {0} matches the text in the enclosed expression. C/C++ identifier: I match the expression ([a-zA-Z_$][a-zA-Z0-9_$]*). String enclosed in quotation marks: Q matching expression ("["] *) | ('['] *). Spaces or tabs: b Matches spaces or tabs. Integer: Z match expression ([0-9]+). Only some regular expressions that can be used for find and replace operations are listed in the reference list. You can also insert any of the following regular expressions into the Find What string: The expression syntax specifies that at least-zero or more @ matches zero or more occurrences of the previous expression and matches as few characters as possible. Minimum- One or more # matches one or more leading expressions and matches as few characters as possible. Repeat n times and n matches the n matches of the leading expression. For example, [0-9] 4 matches all four-digit sequences. Grouping () groups subexpressions into the nth tag text.
In the find or replace expression, indicates the text that matches the nth markup expression, where n is a number between 1 and 9. In the replacement expression, \0 will insert the complete matching text. Right-justified field \(w, n) In the substitution expression, right-justified the nth markup expression in a field with a width of at least w characters. Left-aligned field \(-w, n) In the replacement expression, left-align the nth markup expression in a field with a width of at least w characters. Block matching ~(X) If an x appears in the expression, the block matches. For example, real~(ity) matches "reality" in "reality" and "truth" and does not match "reality" in "reality". Alphanumeric characters: matching expression ([a-zA-Z0-9]). Alphabetic characters: C matching expression ([a-zA-Z]). Decimal number: d matching expression ([0-9]). Hexadecimal number: h matching expression ([0-9a-fA-F]+). Rational number: n matching expressions (([0-9]+[0-9] *) | ([0-9] *. [0-9]+) | ([0-9]+)). Letter string: w matching expression ([a-zA-Z]+). Escape \ e unicode u+001B. Ring the bell \gUnicode U+0007. Backspace key \hUnicode U+0008. Tabs \ tPatch tabs, Unicode U+0009. The Unicode character \ x # # # or \u#### matches the character determined by the Unicode value, where # # # is a hexadecimal number. You can use the ISO 10646 code point or two Unicode code points that give the proxy pair value to specify characters (that is, proxies) outside the basic multilingual plane. The following table lists the syntax when matching by standard Unicode character attributes. The abbreviations of the two letters are the same as those listed in the Unicode character attribute database. These abbreviations can be specified as part of the character set. For example, the expression [:Nd:Nl:No] matches any number. The expression syntax specifies uppercase letters: Lu matches any single uppercase letter. For example, Liuhe matches "this" and does not match "this". Lowercase letters: Ll matches any lowercase letter. For example, Llhe matches "The" but does not match "the". Heading capital letter: It matches a character with a capital letter followed by a lowercase letter, such as Nj and Dz. Decorative letters: Lm matches letters or punctuation marks (such as commas, cross accents and seconds) to decorate leading letters. Other letters: Lo matches other letters, such as the gothic letter ahsa. Decimal number: Nd matches a decimal number (such as 0-9) and its full-angle equivalent. Alphanumeric: Nl matches alphanumeric characters, such as Roman numerals and ideograms of zero. Other numbers: No matches other numbers, such as the old italicized number 1. Left punctuation: Ps matches left punctuation, such as left bracket and left brace. Right punctuation: Pe matches right punctuation, such as right bracket and right brace. Left quotation mark: Pi matches the double quotation mark on the left. Right quotation mark: Pf matches single quotation mark and right double quotation mark. Underline number: Pd matches the underline number. Connection number: Pc matches the underscore symbol. Other punctuation marks: Po match (,,,? 、"、! 、@、#、%、& amp、*、\、(:)、(; ),' and/. Space separator: Zs matches spaces. Line separator: Zl matches Unicode character U+2028. Paragraph separator: Zp matches Unicode character U+2029. Non-placeholder tag: Mn matches the non-placeholder tag. Merge mark: Mc matches the merge mark. Close tag: Me matches the close tag. Mathematical symbols: Sm matches+,=, ~, |,. Currency symbol: Sc matches $ and other currency symbols. Decorative symbols: Sk matches decorative symbols, such as iambic, accent and long notes. Other symbols: So matches other symbols, such as copyright symbol, paragraph mark and degree symbol. Other controls: Cc matches the end of a line. Other formats: Cf format control characters, such as bidirectional control characters. Surrogate: Cs matches half of the proxy pair. Other special purposes: Co matches characters in any special area. Other unassigned characters: Cn matches characters that are not mapped to Unicode characters. In addition to the standard Unicode character attributes, the following additional attributes can be specified as part of the character set. Expression syntax describes letters: Al matches any single character. For example, Alhe matches words like "The", "the" and "reached". Numeric:Nu matches any number. Punctuation: Pu matches any punctuation, such as? , @,' and so on. Spaces: Wh matches any type of spaces, including printed spaces and ideographic spaces. Bidirectional: Bi matches characters written from right to left, such as Arabic and Hebrew characters. Hangul: Ha matches Korean letters and combination letters. Hiragana: Hi matches hiragana characters. Katakana: Ka matches Katakana characters. Ideographic characters/Chinese characters/Chinese characters: Id matches pictographic characters, such as Chinese characters and Chinese characters. Regular Expression Studio 4.0 for Finding Text Expressions Other Versions This topic has not been rated-Evaluate this topic. By using regular expressions, you can perform complex find and replace operations in Microsoft Expression Web. If you don't know the exact text or code you are looking for, or you want to find multiple matches of a text or code string, you can use a positive expression. A regular expression is a text pattern that can describe one or more variants of the text to be searched. Regular expressions are composed of specific characters (such as letters "a" to "z") and special characters that describe text patterns (such as asterisks "*"). For example, to find all variants of "page" in the website, you can search for "page*". In this way, Expression Web will find all instances of "page", "pages", "pager" and any other words that start with "page" in the website. When using regular expressions in search, specific rules will control which character combinations will perform specific matching operations. Every regular expression (or combination of regular expressions) is called grammar. You can use multiple regular expressions in a grammar to exactly match the target you are searching for. To use regular expressions, see Editing Multiple Web Pages Using Find and Replace. Regular expression syntax syntax expression description. Any character is used as a line break (
Wildcards for any single printed or unprinted character other than). For example, the regular expression c.t can match strings such as cat, c t and cot, but it can't match cost. In this example, the period (. ) is a wildcard representing a single character. It appears between the letters "c" and "t", so any single character between the characters "c" and "t" matches the expression-even a space. * Maximum zero or more is used to match characters that appear zero or more times before the expression, and can match as many characters as possible. Regular expression. * Used to match characters that appear zero or more times. For example, the regular expression b.*k can match book, back, black, blank and buck. In this example, a period (. ) and the asterisk (*) are combined into a grammar. Period (. ) immediately before the asterisk (*) expression. An asterisk (*) can match any character that appears zero or more times between "b" and "k". Period (. ) is used as a wildcard for characters between "b" and "k". In this example, it means that any character between "b" and "k" can be repeated. +Maximum one or more is used to match the characters that appear one or more times before this expression, and as many characters as possible can be matched. Regular expression. +is used to match characters that occur one or more times. Such as the regular expression bo+. Can match bob, book and boot. In this example, the period (. ) and the plus sign (+) are combined into a grammar. Period (. ) immediately after the plus sign (+) expression. A plus sign (+) can match the letter "o" that appears one or more times. Period (. ) is used as a wildcard for the last character of each word. In this example, the characters are "b", "k" and "t". @ Minimum zero or more is used to match characters that appear zero or more times before the expression, and can match as few characters as possible. Regular expression. @ is used to match zero or more occurrences of characters. For example, the regular expression a.@x can match "abx" in "abxbxb" and "acx" in "acxcxc". In this example, the period (. ) and the @ sign are combined into a grammar. Period (. ) immediately before the @ symbol expression. The @ symbol can match any character that appears zero or more times between "a" and "x". In this example, the period (. ) is used as a wildcard for characters "b" and "c" between characters "a" and "x". # Minimum is one or more characters, which are used to match the characters that appear one or more times before the expression, and can match as few characters as possible. Such as the regular expression si. #er can be used with "sicker" or "silkier". In this example, a period (. ) and a pound sign (#) to form a grammar. Period (. ) immediately before the pound sign (#) expression. The pound sign (#) can match any character that appears one or more times between "si" and "er". Period (. ) are used as wildcards for the characters "c" and "k" in the word sicker and the characters "l", "k" and "i" in the word Silk. The [] character set is used to match any character in parentheses ([]). You can use a hyphen (-) to specify a range of characters, such as [a-z]. For example, the regular expression c[aou]t can match cat, cot and cut, but not cet or cit. The regular expression [0-9] means to match any number. You can also specify multiple ranges of letters. The regular expression [A-Za-z] means to match all uppercase and lowercase letters. The row header is located where the row header matches. For example, the regular expression When in matches any string that starts with "when in" and appears at the beginning of a line, such as "when in" or "When in town, call me". However, this regular expression does not match "What and when in the process of human events" at the beginning of the line. The $ line end is located at the matching line end. For example, the regular expression professional$ can match the string "He is a professional" but not the string "They are a group of professionals". The beginning of the file is at the beginning of the file to be matched. Only applicable to searching for text in source code or text files. For example, to match the first HTML tag at the beginning of a file, use the following regular expression: $ $ Locate the end of the file at the end of the file to be matched. Only applicable to searching for text in source code or text files. For example, to match the last HTML tag at the end of the file (there is no space after the tag), you can use this regular expression: $| or an expression that indicates a choice between two items, that is, an expression that matches before and after the OR symbol (|). For example, the regular expression (him|her) matches the following items: "It belongs to him" or "It belongs to her", but does not match the line "It belongs to them". \ Escape special characters are used to match the characters after the backslash (\). In this way, you can find the characters used in regular expression grammar (such as opening brace ({) or caret ()) or some other special characters. For example, using \ $ can match dollar sign ($) characters instead of executing a regular expression for "positioning at the end of a line". Again, use \. Can match a period (. ) character, instead of matching anything like a period (. ) Regular expression. {} Tags the expression to mark the text that matches the expression in parentheses. You can use \N to match tagged text that appears elsewhere in the lookup expression, or to insert tagged text into the replacement expression. For example, suppose you want to find a word that appears twice in a row. To search, use the following expression: {. #} \ 1 Assuming that consecutive words are separated by spaces, you need to add a space between the closing brace (}) and the backslash (\). In this example, the pound sign (#), period (. ) and braces ({}) are combined into a grammar. In this expression,. # means any continuous character. Because this part of the expression is enclosed in braces ({}), consecutive characters will be marked and referenced as 1. This expression will look for any consecutive characters with exactly the same characters followed by spaces. \ nThe nth tag expression in the lookup expression \ nMatches the text specified by the nth tag expression, where n is a number from 1 to 9. In the replacement expression, \ nInsert the text that matches the nth markup expression, where n is a number between 1 and 9. \0 Inserts the text specified by the entire lookup expression. For example, suppose you want to find words that appear twice in a row and replace them with one word. To search, use the following expression:. #} \ Assuming that consecutive words are separated by spaces, you need to add a space between the closing brace (}) and the backslash (\). In this example, the pound sign (#), period (. ) and braces ({}) are combined into a grammar. To replace, use the following expression: \l\ 1 indicates what is found in the first pair of braces of the lookup string. By using 1 in the replacement operation, you are actually replacing a word that appears twice in a line with a word. The () group expression marks the beginning and end of the subexpression. A subexpression is a regular expression contained in (), such as the expression: (ha)+ In this example, the plus sign (+) and the parenthesis () expressions are combined into a grammar. The subexpression is (ha) because it is enclosed in parentheses (). After adding a plus sign (+), the expression can find duplicate letter pairs. A plus sign (+) indicates that "ha" occurs one or more times. This expression can be matched with the following: "Ha ha" and "Ha ha ha". ~x prevents matching. When x appears at this position in the expression, it will prevent matching. For example, the regular expression real~(ity) can match the "real" in "reality" and "really", but it cannot match the "real" in "reality".
Line breaks are used in Code view or
) is an easy way to match all line breaks. \t Tabs are used to match a single tab. For example, if you want to find all the tabs at the beginning of a line, you can use this regular expression: \t+ In this example, the caret (+) and tab (\ t) are combined into a grammar. The caret () precedes a single tab expression and is used to match all tabs at the beginning of a line. A plus sign (+) indicates that one or more tabs match. [] Any character that does not belong to this set is used to match any character that is not included in the character set after the caret (). For example, to match any character outside the range, you can use the caret () as the first character after the left parenthesis. The expression [269a-z] matches all characters except 2, 6, 9 and any capital letters. N repeated expressions are used to match expressions that appear n times before the caret (). For example, if n is 4, the expression [0-9] 4 matches any 4-digit sequence. In this example, the syntax of character set ([]) is combined with the syntax of repetition (n) to show a more practical regular expression method. : alphanumeric characters are used to match the expression [a-zA-Z0-9]. You can use the expression [a-zA-Z0-9] to match one occurrence of letters (uppercase or lowercase) or numbers. Also known as "alphanumeric matching". Shorthand expression: A can be used instead of [a-zA-Z0-9]. : b Spaces are used to match any spaces in code or text. For example, to match a single space character at the beginning of a line, you can use this regular expression:: b: c alphabetic characters to match the expression [a-zA-Z]. When using this expression, you can match all uppercase or lowercase letters. You can use the shorthand expression: c instead of all [a-zA-Z]. : d Decimal number is used to match the expression [0-9]. You can match any number with this expression. For example, suppose you want to find the social security number of the United States in a text file. The format of American social welfare number is 999-99-9999. : d 3-:d 2-:d 4 or [0-9] 3-[0-9] 2-[0-9] 4 (represented by [0-9]) can return the same result. You can use the shorthand expression: d instead of all [0-9]. : h Hexadecimal number is used to match the expression [0-9a-fA-F]+ Use this expression to match hexadecimal numbers composed of uppercase or lowercase letters between "a" and "f" and any number. For example, suppose the pages in your website use different background colors, and you want to change the color of these pages to black (that is, 000000). However, you don't know the hexadecimal value of the existing color. Use this regular expression to find all existing hexadecimal values: \#:h You can search with [0-9a-fA-F], but in this case, the syntax of backslash (\), pound sign (#) and hexadecimal number (:h) are combined. \ # matches the pound sign (#) of a non-expression and: h matches any hexadecimal character sequence. To replace the existing hexadecimal value, you can type the hexadecimal value of the required background color: 000000:i Identifier is used to match the expression [a-zA-Z_$][a-zA-Z0-9_$]* When processing code, if you need to match all program identifiers, you can use the shortened expression: i without typing the above lengthy expression. : n rational numbers are used to match the expression ([0-9]+\. [0-9] *) | ([0-9] * \. [0-9]+) | ([0-9]+) If you need to match the whole numerical value with decimal points, you can use the abbreviated expression: n, without typing the lengthy expression above. : q quoted strings are used to match expressions ("[~"] *) | ('[~'] *) If you need to match all quoted words, you can use the shorthand expression: q instead of typing the lengthy expression above. : w alphabetic strings are used to match the expression [a-zA-Z]+ This grammar is a simple way to match one or more uppercase or lowercase alphabetic characters. : zinger is used to match the expression [0-9]+ This syntax is a simple way to match any integer.