:noh[lsearch] Stop the highlighting for the 'hlsearch' option. It is automatically turned back on when using a search command, or setting the 'hlsearch' option. While typing the search pattern the current match will be shown if the 'incsearch' option is on. Remember that you still have to finish the search command with to actually position the cursor at the displayed match. Or use to abandon the search. All matches for the last used search pattern will be highlighted if you set the 'hlsearch' option. This can be suspended with the :nohlsearch command. ============================================================================== 7. Ignoring case in a pattern */ignorecase* If the 'ignorecase' option is on, the case of normal letters is ignored. 'smartcase' can be set to ignore case when the pattern contains lowercase letters only. */\c* */\C* When "\c" appears anywhere in the pattern, the whole pattern is handled like 'ignorecase' is on. The actual value of 'ignorecase' and 'smartcase' is ignored. "\C" does the opposite: Force matching case for the whole pattern. ============================================================================== Searching and Patterns Trailing "/" or "?" ------------------- For search commands in normal mode the trailing '/' or '?' is neither required nor allowed. Regular expression metacharacters --------------------------------- Note: Since Java1.5, jVi uses java.util.regex only. Check the javadoc for exact syntax description. The following description on how meta character escaping works is still applicable. Both Vim and jVi support Perl5 regular expressions. In Vi, the pattern metacharacters are '\', '(', ')', '[', '^', '$', '*' and '.'. Of these, in Vi '(' and ')' need to be escaped to be used as a metacharacter. Perl5 regular expressions add the metacharacters '|', '{', '+' and '?'. In vim all of '(', ')', '|', '{', '+' and '?' need to be escaped to use them as metacharacters. For example, in vim the pattern "\(foo\|bar\)" matches either foo or bar. As a further twist, in Perl5 the '?' is used to indicate that an atom is optional, vim uses '=' instead of '?'. So, in vim "ab\=c" matches "ac" or "abc", this is written "ab?c" in Perl5. By default, jVi has the same metacharacters and escaping requirements as vim, including the swap of '=' for '?'. However, this is configurable with two variables: metaEquals and metaEscape. metaEquals is a boolean, when true it says to use '=' instead of '?'. metaEscape is a string which includes the metacharacters that must be be escaped. metaEscape defaults to "()|+?{". The characters listed in metaEscape must be preceded by a '\' in order to be treated specially. If metaEquals is false and metaEscape is empty, then the metacharacters are treated exactly as in Perl5; for example, the pattern "(foo|bar)" would match either foo or bar. In this case, if you wanted to match a '(' it would have to be escaped, for exaple "someProc\(" matches someProc(. Regular expression greedy and smallest matching ----------------------------------------------- Note: Java1.5 regular expression support "greedy","reluctant" and "possesive" matching. By default in Vi, Vim and Perl5, regular expressions are "greedy", this means they match as much as possible. This applies to the quantifiers '{n,m}', '{n,}', '{n}', '*', '+' and '?'. For example, the pattern ".*foo" matches the last foo in the line, since the '*' is greedy and ".*" matches as much as possible. "Reluctant" means to find the smallest matches, in Perl5 you append '?' to the quantifier. For example, ".*?foo" matches the first foo in the line. "Possessive" quantifiers greedily match as much as they can and do not back off, even when doing so would allow the overall match to succeed, in Java syntax you append '+' to indicate possesive matching. For example, ".*+foo" will never match because the ".*" picks up the whole line and there is never anything left for "foo" to match. Character classes and assertions -------------------------------- Character classes as defined in Java spec are available. For example, \w matches a word character and \W matches a non word character. The Assertions are as defined in Java, for example, \b is a word boundary. In patterns input by the user, both \< or \> are replaced by \b (word boundary. This gives the expected behavior.