Editing (section) Search across multiple lines 0 We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free. ==Patterns including end-of-line== The search <code>/^abcd</code> finds <code>abcd</code> at the beginning of a line, and <code>/abcd$</code> finds <code>abcd</code> at the end of a line. However, in <code>/abcd^efgh</code> and <code>/abcd$efgh</code> the <code>^</code> and <code>$</code> are just ordinary characters with no special meaning. By contrast, each of the following has a special meaning anywhere in a search pattern. {| class="cleartable" | <code>\n</code> || a newline character (line ending) |- | <code>\_s</code> || a whitespace (space or tab) or newline character |- | <code>\_^</code> || the beginning of a line (zero width) |- | <code>\_$</code> || the end of a line (zero width) |- | <code>\_.</code> || any character including a newline |} Example searches: ;<code>/abcd\n*efgh</code> :Finds <code>abcd</code> followed by zero or more newlines then <code>efgh</code>. :Finds <code>abcdefgh</code> or <code>abcd</code> followed by blank lines and <code>efgh</code>. :The blank lines have to be empty (no space or tab characters). ;<code>/abcd\_s*efgh</code> :Finds <code>abcd</code> followed by any whitespace or newlines then <code>efgh</code>. :Finds <code>abcdefgh</code> or <code>abcd</code> followed by blank lines and <code>efgh</code>. :The blank lines can contain any number of space or tab characters. :There may be whitespace after <code>abcd</code> or before <code>efgh</code>. ;<code>/abcd\_$\_s*efgh</code> :Finds <code>abcd</code> at end-of-line followed by any whitespace or newlines then <code>efgh</code>. :There must be no characters (other than a newline) following <code>abcd</code>. :There can be any number of space, tab or newline characters before <code>efgh</code>. ;<code>/abcd\_s*\_^efgh</code> :Finds <code>abcd</code> followed by any whitespace or newlines then <code>efgh</code> where <code>efgh</code> begins a line. :There must be no characters (other than a newline) before <code>efgh</code>. :There can be any number of space, tab or newline characters after <code>abcd</code>. ;<code>/abcd\_$efgh</code> :Finds nothing because <code>\_$</code> is "zero width" so the search is looking for <code>abcdefgh</code> where <code>abcd</code> is also at end-of-line (which cannot occur). ;<code>/abcd\_^efgh</code> :Finds nothing because <code>\_^</code> is "zero width" so the search is looking for <code>abcdefgh</code> where <code>efgh</code> is also at beginning-of-line (which cannot occur). ;<code>/abcd\_.\{-}efgh</code> :Finds <code>abcd</code> followed by any characters or newlines (as few as possible) then <code>efgh</code>. :Finds <code>abcdefgh</code> or <code>abcd</code> followed by any characters then <code>efgh</code>. ;<code>/abcd\(\_s.*\)\{0,18\}\_sefgh</code> :Finds a block of 0 to 18 lines enclosed by <code>abcd</code> and <code>efgh</code>. :limiting the number of lines is important, replacing this by a star will cause vim to consume 100% CPU. Loading editor Below are some commonly used wiki markup codes. Simply click on what you want to use and it will appear in the edit box above. Insert: – — … ° ≈ ≠ ≤ ≥ ± − × ÷ ← → · § Sign your username: ~~~~ Wiki markup: {{}} | [] [[]] [[Category:]] #REDIRECT [[]] <s></s> <sup></sup> <sub></sub> <code></code> <blockquote></blockquote> <ref></ref> {{Reflist}} <references/> <includeonly></includeonly> <noinclude></noinclude> {{DEFAULTSORT:}} <nowiki></nowiki> <!-- --> <span class="plainlinks"></span> Symbols: ~ | ¡ ¿ † ‡ ↔ ↑ ↓ • ¶ # ¹ ² ³ ½ ⅓ ⅔ ¼ ¾ ⅛ ⅜ ⅝ ⅞ ∞ ‘ “ ’ ” «» ¤ ₳ ฿ ₵ ¢ ₡ ₢ $ ₫ ₯ € ₠ ₣ ƒ ₴ ₭ ₤ ℳ ₥ ₦ № ₧ ₰ £ ៛ ₨ ₪ ৳ ₮ ₩ ¥ ♠ ♣ ♥ ♦ View this template This field is a spam trap. DO NOT fill it in! Edit summary Preview Mobile Desktop Show changes