Specifying a Line Range, without using Line Numbers

One of the little-known features of Qedit commands is their ability to use strings as a rangelist. Use them in any command that accepts a rangelist, and then that command will be applied only to lines containing that string. Strings can be delimited by quotes, or by any of the following special characters: | ~ _ ! # > &:. You can further qualify strings if you use window options on the string being searched.

Some examples:

Deleting all lines with the string "superfluous".

   /delete "superfluous" 
Deleting all lines without the string "superfluous".
   /delete "superfluous" (nomatch) 
Change "bug" to "undocumented feature", but only on those lines that have the string "unexplained".
     /change "bug"undocumented feature" "unexplained" 
Delete all blank lines.
     /delete "~" (pattern)    {blank lines}
Find the next occurrence of the string ".font" that starts in the first column.
     /find ".font" (1/5) 
List all occurrences of "Frank", but not in words such as "Frankenstein".
     /list "Frank" (smart)   {ignores "Frankenstein"} 

By default, Qedit searches for matches to a string. Specifying (NOMATCH) reverses this logic. Likewise, string searches can be restricted to particular columns (10/40), or to a caseless search (UPSHIFT).

If the string represents a pattern, this should be specified with valid pattern characters:
@ anything, including nothing
# single numeric digit
? single alphanumeric digit
~ zero or more spaces

[Taken from the "Qedit's Forgotten Commands" tutorial given at Interex in Toronto.]

....Back to the Qedit Q&A Page