(→Related Resources) |
(→Related Resources) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 44: | Line 44: | ||
:Match any (non-standard) control character other than Tab, Carriage-Return and Line-Feed. It is useful for finding stray control characters in a file. See also '''|C''' and '''|G'''. | :Match any (non-standard) control character other than Tab, Carriage-Return and Line-Feed. It is useful for finding stray control characters in a file. See also '''|C''' and '''|G'''. | ||
;|L | ;|L | ||
| − | :Match the “newline” character(s) Carriage-Return and/or Line-Feed depending upon the file type. With Windows/DOS files, the Carriage-Return is optional. | + | :Match the “newline” character(s) Carriage-Return and/or Line-Feed depending upon the file type. With Windows/DOS files, the Carriage-Return is optional. Also see '''|N''' and [[Pattern_Matching_Newline|Pattern Matching the Newline]]. |
;|M | ;|M | ||
:Match multiple characters - zero, one or more characters until the string following the '''|M''' is satisfied. Since the match may cover many lines, it may match a huge number of characters. Use '''|*''' instead, to match multiple characters on one line. This code is not generally not useful as the first item in a search string. See also '''|Y''' and the following sub-topic “Matching Multiple Characters”. | :Match multiple characters - zero, one or more characters until the string following the '''|M''' is satisfied. Since the match may cover many lines, it may match a huge number of characters. Use '''|*''' instead, to match multiple characters on one line. This code is not generally not useful as the first item in a search string. See also '''|Y''' and the following sub-topic “Matching Multiple Characters”. | ||
;|N | ;|N | ||
| − | :Match the “newline” Carriage-Return and/or Line-Feed depending upon the file type. With Windows/DOS files, the Carriage-Return is mandatory. This code can also be used in the replacement string. See also '''|L'''. | + | :Match the “newline” Carriage-Return and/or Line-Feed depending upon the file type. With Windows/DOS files, the Carriage-Return is mandatory. This code can also be used in the replacement string. See also '''|L''' and [[Pattern_Matching_Newline|Pattern Matching the Newline]]. |
;|Oooo | ;|Oooo | ||
:Match the character with octal value ‘ooo’. Three digits MUST be present. This code can also be used in the replacement string. | :Match the character with octal value ‘ooo’. Three digits MUST be present. This code can also be used in the replacement string. | ||
| Line 87: | Line 87: | ||
:Use the contents of text register ‘r’ in this position in the search string. This code can also be used in the replacement string. | :Use the contents of text register ‘r’ in this position in the search string. This code can also be used in the replacement string. | ||
;|{set} | ;|{set} | ||
| − | :Match any one item in the “pattern set”. | + | :Match any one item in the “pattern set”. [[Pattern_Matching_Sets|Learn more about Pattern Matching Sets.]] |
;|[set] | ;|[set] | ||
| − | :Match one optional occurrence of any item in the “pattern set”. This code is not meaningful as the first item in a search string. | + | :Match one optional occurrence of any item in the “pattern set”. This code is not meaningful as the first item in a search string. [[Pattern_Matching_Sets|Learn more about Pattern Matching Sets.]] |
;|| | ;|| | ||
:Match the “|” character. You need a double “||” to search for a single “|” in your text. A double “||” is also needed on the replacement side. | :Match the “|” character. You need a double “||” to search for a single “|” in your text. A double “||” is also needed on the replacement side. | ||
==Pattern Matching== | ==Pattern Matching== | ||
| − | |||
*[[Pattern_Matching_Newline|Pattern Matching the Newline]] | *[[Pattern_Matching_Newline|Pattern Matching the Newline]] | ||
*[[Pattern_Matching_Beginning_End|Pattern Matching the Beginning / End]] | *[[Pattern_Matching_Beginning_End|Pattern Matching the Beginning / End]] | ||
| Line 102: | Line 101: | ||
==Related Resources== | ==Related Resources== | ||
| + | *[[Main_Page| Wiki Home Page]] | ||
| + | *[[Search_And_Replace|Search & Replace Overview]] | ||
Pattern Matching makes it possible to search not only for particular characters, but also for types of characters such as “any digit” or for characters that meet special conditions such as "occurring at the beginning of a line”.
These generalized searches are performed by using “pattern matching codes” within the search string. Each pattern matching code consists of the special character “|” followed by another character, typically a mnemonic letter.