vim

Regular expressions in Ex Mode

Edit a regular expression in Ex mode

Suppose you are searching for a Title Case pattern in a large text file and you want to edit a incorrect regular expression:

  1. First, go into Ex mode by typing q:
  2. You will now see all the commands that you typed in commandline mode, press j to go the regular expression you want to edit (/\v[A-Z]\w+\s[A-Z]\w+)
  3. Once done, press ESC to go to normal mode
  4. Then press Enter to run the search patten

Here is a screen shot demonstrating a Title Case search

enter image description here

enter image description here


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow