Rob van der Woude's Scripting Pages

Help text for RxReplace.cs

(view help text of RxReplace.cs as plain text)

RxReplace,  Version 1.02
Multi-line regex find and replace tool

Usage:   RXREPLACE  filename  pattern  replacement  [ options ]
or:      some_command  |  RXREPLACE  pattern  replacement  [ options ]

Where:   filename       is the file to be filtered
         some_command   is the command whose standard output is to be filtered
         pattern        is the regex pattern for text to be replaced
         replacement    replaces all matches (backreferences allowed, e.g. $1)

Options: /F:bytes       search the First specified number of bytes only
         /I             makes the search case Insensitive
         /L             treat replacement as Literal text
                        (default: unescape replacement)
         /O[:newfile]   Overwrite original, or write Output to newfile
         /S:nn          Skip the first nn matches
         /T:nn          Take only nn matches

Notes:   If /F:bytes is used and a file is specified, only the first bytes
         of that file will be read; if the input is redirected, it is read
         entirely, and will then be chopped to the specified number of bytes
         before being searched. In both cases, the remainder of the input will
         be discarded.
         Unless /O switch is used, result will be written to Standard Output.
         Backreferences in replacement can not be used with /S or /T.

Credits: Check for redirection by Hans Passant on StackOverflow.com:
         http://stackoverflow.com/a/3453272
         Array Slice extension by Sam Allen on DotNetPerls.com:
         http://www.dotnetperls.com/array-slice
         Unescaping Unicode by "dtb" on StackOverflow.com:
         http://stackoverflow.com/a/8558748

Written by Rob van der Woude
http://www.robvanderwoude.com

page last uploaded: 2022-10-05; loaded in 0.0166 seconds