.Dd September, 2002 .Dt REP 1 .Os Rep 2.3 .Sh NAME .Nm rep .Nd a regular expression search and replace language .Sh SYNOPSIS .Nm .Op Fl ipq .Op Fl z Ar buffsize .Ar script .Op Ar infile .Op Ar outfile .Nm .Fl f .Op Fl bipq .Op Fl z Ar buffsize .Ar script .Ar file .Ar .Sh DESCRIPTION The .Nm scripting language is a regular expression language used for fine grained, buffer based search and replace. It is not limited to lines. A full description of what .Nm is capable of is outside the scope of this document. .Pp .Ar script is a text or compiled .Nm script. For details see the language documentation that came along with the distribution. .Pp When used with the .Fl f argument .Nm replaces files in place. Otherwise it reads from .Ar infile and writes to .Ar outfile \&. If either infile or outfile are missing or are equal to a dash .Sq Li - , then rep processes .Em stdin or .Em stdout respectively. .Sh OPTIONS The options are as follows: .Bl -tag -width Fl .It Fl b Backup files where replacements have occurred. The backup files have an .Sq x_r extension appended to their filename. .It Fl i Prompt for confirmation before each replacement. .It Fl p Only output replaced text. Can be used as a rudimentary parser. .It Fl q Supress status messages. Only errors will be sent to stderr. .It Fl z Set the replacement buffer size to .Ar buffsize . This speeds up execution as regular expressions only have to act on a small portion of the whole file at once. However the largest match will be limited to roughly .Ar buffsize , so use this option with care. The script loops over each buffer until no more matches are found within it. Care is taken to overlap the buffers as much as possible to ensure that any match smaller than .Ar buffsize can be matched. .Sh NOTE The .Nm command uses .Xr getopt 3 to parse it's arguments, which allows it to accept the .Sq Li -- option which will stop processing of flag options at that point. This allows the processing of files with names that begin with a dash .Pq Sq - . .Sh BUGS When reading from .Em stdin you must specify a buffer size. .Sh SEE ALSO .Xr repc 1 , .Xr rlib 3 , .Xr pcre 3 .Sh AUTHOR .An Nate Nielsen Aq nielsen@memberwebs.com