Tutorial 4 | VI Editors | Jump to PICO Editors tutorial
When using the [ / ] or [ ? ] commands a line will be cleared along the bottom of the screen. You enter the search string followed by [ RETURN ] .
The string in the command [ / ] or [ ? ] can be a regular expression. A regular expression is a description of a set of characters. The description is build using text intermixed with special characters. The special characters in regular expressions are . * [] ^$.
- . Matches any single character except newline.
- \ Escapes any special characters.
- * Matches 0 or More occurances of the preceding character.
- [] Matches exactly one of the enclosed characters.
- ^ Match of the next character must be at the begining of the line.
- $ Matches characters preceding at the end of the line.
- [^] Matches anything not enclosed after the not character.
- [-] Matches a range of characters.
The only way to get use to the regular expression is to use them. Following is a series of examples.
- c.pe Matches cope, cape, caper etc
- c\.pe Matches c.pe, c.per etc
- sto*p Matches stp, stop, stoop etc
- car.*n Matches carton, cartoon, carmen etc
- xyz.* Matches xyz to the end of the line.
- ^The Matches any line starting with The.
- atime$ Matches any line ending with atime.
- ^Only$ Matches any line with Only as the only word in the line.
- b[aou]rn Matches barn, born, burn.
- Ver[D-F] Matches VerD, VerE, VerF.
- Ver[^1-9] Matches Ver followed by any non digit.
- the[ir][re] Matches their,therr, there, theie.
- [A-Za-z][A-Za-z]* Matches any word
