Capture Settings, Text Replacement

Top  Previous  Next

Capture Settings are set-up separately for each capture channel.  Once these settings have been specified, OK or Apply should be clicked.  This tab specifies Text Replacement information.

 

cm5-1-set-text

 

Search and Replace Text in a Record

Provides a means to modify captured text data before it is logged or displayed, by searching a record (usually a line) for one of more phrases, which are replaced with alternative text.

 

Search Method

Specifies how text will be searched, similarly to Capture Filters and Capture Alerts,

 

Simple Phrase

Searches for an exact match for the text entered, except case insensitive if so specified.

Simple Wildcard (!*)

Similar to file searching where ! matches any one character and * matches zero or more characters, each with multiples allowed in the same phrase.  So phrase al!rm will match alarm or alxrm, and a*rm will match alarm, axxxxrm or arm.

Regular Expression

More flexible than wildcards, but complicated to understand usually requiring several pages of help to explain.  Fortunately there are numerous web sites with RegEx tutorials, such as https://regexone.com/, https://www.rexegg.com/ and https://www.regular-expressions.info/tutorial.html. Note that regular expressions reserve many symbols for commands ([]()?+.}^$|\*) and search for any of these reserved symbols needs to be escaped by preceding with backslash, ie \\ for one backslash. Wildcard is period, ^ is start of record anchor, $ is end of record anchor, \< is start is start of word, \> is end of word. So ^alarm would find that word at the start of the record only and the wildcard example al!rm above really searches for al.rm.

 

Search Text, Replacement Text

A phrase that will will be replaced by alternate text.   Searching is optionally case sensitive, see below. More than one replacement may occur for a record if multiple searches are specified, but will also find any previous replacements.

 

Text Replacement also allows found text to be replaced by a space or a blank, ie deleted.  Both Search and Replacement text may include escaped characters, specifically \s for space, \_ for blank and \\ for backslash (\), similarly to 'Add Custom Text to Captured Lines'. When searching text, this also allows trailing spaces to be searched and replaced.

 

The button bar allow loading captured text from a file or the capture window, similarly to Filters, clicking on a capture line will show any replacements that will occur.  Text Replacement is processed after most record processing, but before adding Custom text to the record or a time stamp.

 

Case Insensitive Match

Searching phrases is case sensitive unless this option ticked.