File:  [CSRG BSD Unix] / 42BSD / usr.lib / learn / editor / L33.2b
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:54 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD42
BSD 4.2

#print
You can of course use the [] operators anywhere in
a pattern.  Editor patterns, by the way, are called
"regular expressions".  For example, suppose you wanted
to change either the word "trick" or the word "track"
to "stop".  What command would you need?
Do you see that

  s/tr[ia]ck/stop/p

will do that?  Now figure out what command you would
need to change either "bear" or "beat" into "best"
and print the line after the change.
Type "answer COMMAND" where COMMAND is that line.
#copyin
#user
#uncopyin
#match s/bea[rt]/best/p
#match s/bea[tr]/best/p
#match s/bea[rt]/best/
You forgot the "p" part.
#match s/bea[tr]/best/
You forgot the "p" part.
#log
#next
33.2c 5

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.