home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / ME22-OS2.ZIP / MEHELP.ZIP / MEHELP.10 < prev    next >
Text File  |  1980-01-01  |  2KB  |  49 lines

  1.                    SEARCH AND SUBSTITUTION COMMANDS
  2.  
  3. <+SEARCH>  (the F5 key) searches from the cursor position forwards for
  4. the specified pattern. 
  5. <-SEARCH> (SHIFT F5 key) searches backwards from the  cursor  position
  6. for the specified pattern. 
  7.     For the two commands above, you are allowed  to  put  any  regular
  8. expression  as  a  pattern.  
  9.   Regular expressions consist of the following metacharacters : 
  10.   ^  matches the beginning of a line
  11.   $  matches the end of a line
  12.   ?  matches any character
  13.   *  matches 0 or more occurences of the previous pattern
  14.   +  matches 1 or more occurences of the previous pattern
  15.   [] character class
  16.   a|b  matches pattern a or pattern b
  17.   \(a\)  tags pattern a
  18.   \n   refers to tagged pattern n. N is a digit from 1 to 9.
  19.  
  20. When you invoke these commands, you will be given the previous pattern
  21. you typed in as a default. If you press <RETURN>, that pattern will be
  22. used again. (If the previous pattern shown to you ends with a '!',  it
  23. means that you wanted to ignore the case.)
  24.  
  25. <TOGGLE CASE> (the ALT F5 key) toggles case sensitivity for searching.
  26.  
  27. <+SUBST> (F6 key) searches from the cursor position forwards  for  the
  28. specified  pattern, and for each occurence of the pattern, substitutes
  29. the replacement string. 
  30. <-SUBST> (SHIFT F6 key) searches backwards from the  cursor  position,
  31. then substitutes the replacement string. 
  32.     The replacement string can have the metacharacter '&', which means
  33. to  substitute  the  matched  pattern  as part of the replacement. For
  34. instance, if your pattern to search for was 'cat', and the replacement
  35. string is 'alley&', then the word 'alleycat' will be replaced for each
  36. occurence of 'cat'.
  37.     In  the substitution text, you may also refer to a tagged pattern.
  38. For example, let's say that the pattern that you searched for was :
  39.   \(dog\) = \(cat\)
  40. If you want to replace every occurence of "dog = cat" by "cat =  dog",
  41. then the substitution pattern that you specify can be :
  42.   \2 = \1
  43.  
  44.     You  are  asked  if  you want to approve each substitution. If you
  45. reply 'n', then the replacements will be made globally from the cursor
  46. position to the end (or beginning) of the file. If you reply 'y', then
  47. when the pattern is found you are asked if you  want  to  replace  it,
  48. ignore it, or stop the substitution operation totally.
  49.