O+S& O-S& Set "&" option in S O+S/ O-S/ Is final "/" necessary? O+SD O-SD Case duality option O+Sccc O-Sccc Set pattern characters
o+sd o-s& o-s[^$+ o-s/
s/AB/&C/
will change all AB strings into ABC. This is the default.
O+S&
also allows you to use brace brackets to tag portions of patterns, as ins/me{ow}a/ba-wa/
For the scope of this one S command only, occurrences of the letter a on the right hand side of the S are taken as shorthand for the string matching the pattern inside the braces. Thus the given command is equivalent to
s/meow/bow-wow/
If O+S& is in effect, \C& can be used on the right hand side of an S command to refer to an & without its special meaning; and if a tag t is used in a {pattern}t construction, \Ct may be used to refer to t itself on the right hand side of an S command. For example,
s/me{ow}a/ba-w\Ca/
turns meow into bow-wa.
If O-S& is in effect, \O& on the right hand side of an S command refers to the special meaning of &, not & itself.
{ ( [ . * ^ $ | \E + @ # -
Note that ] is not in this special character list, since ] is special only when it follows [. Similarly, we have omitted } and ). The - in the list refers to the ability to use ranges in [string] constructions.
O+S can enable the special meanings of these characters. For example, O+S.*{ enables the special meanings of ".", *, and { in pattern matching. O-S disables the special meanings of the list of characters which come after it.
The default options are
O+S^$.*[\E- O-S{(|+@#
\C can turn off the special meaning of enabled characters and \O can turn on the special meaning of disabled characters.
s/pattern/string
With O-S/ in effect, FRED effectively treats the new-line at the end of the line as a closing delimiter. O-S/ also allows the closing delimiter to be omitted in line searches (e.g. /....), in E commands, in G commands which have no command-list, in jump commands like JM and JP, and in T, ZL, ZT and ZU.
The default is O+S/, which means that the closing delimiter is required.
O+S and O-S set the condition register TRUE if any of the options they are turning on or off were previously on, and FALSE if all the options were previously off. This is useful when writing buffers that may have different string options from those in a user's init buffer.
If you use an E command to associate a name with a pattern, the options that pertain to the pattern are the ones that were in effect when the E command was issued. For example, if (yy) is defined with
E(yy)/[1234567890]/
\E(yy) will always match a digit, even if [ is later turned off by O-S[. Similarly, if O+SD is in effect when you say
E(xx)/this/
\E(xx) which match this, THIS, This, etc. even if the O-SD option is set later.
Copyright © 1998, Thinkage Ltd.