Regular Expression Syntax

Regular Expression Syntax

Syslog Watcher uses ECMAScript regular expressions pattern syntax (similar to JavaScript's regular expression flavor). A brief syntax reference: http://www.cplusplus.com/reference/regex/ECMAScript/
Here are the most frequently requested examples:

Messages that contain Word1

  1. Word1

Messages that begin with Word1

  1. ^Word1

Messages that end with Word1

  1. Word1$

Messages that contain Word1 OR Word2

  1. Word1|Word2

Messages that do NOT contain Word1

  1. ^((?!Word1).)*$

Messages that contain Word1 AND THEN Word2 

  1. Word1.*Word2

Messages that contain Word1 AND Word2 (any order) 

  1. Word1.*Word2|Word2.*Word1
or 
  1. (?=.*Word1)(?=.*Word2)

Messages that do NOT contain Word1 AND Word2 

  1. ^((?!Word1|Word2).)*$

Messages that contain Word1, but NOT Word2

  1. ^((?!Word2).)*Word1((?!Word2).)*$

    • Related Articles

    • Syslog Watcher 4.8

      Summary Syslog Watcher 4.8 is a maintenance update of the version 4.7.x. It contains several important bugfixes and internal improvements, but no new features. However, the version number was changed to 4.8 because it has updated copyright ...
    • Upgrade to Syslog Watcher 5.1

      This article describes how to upgrade Syslog Watcher 5.0.x to version 5.1.x only. Back up Syslog Watcher configuration Stop Syslog Watcher Server Close Syslog Watcher Manager (GUI application) Install Syslog Watcher 5.1 using the MSI file downloaded ...
    • Upgrade to Syslog Watcher 5.2

      This article describes how to upgrade Syslog Watcher 5.0.x/5.1.0 to version 5.2.x only. Back up Syslog Watcher configuration Stop Syslog Watcher Server Close Syslog Watcher Manager (GUI application) Install Syslog Watcher 5.2 using the MSI file ...
    • Upgrade to Syslog Watcher 5.0

      The upgrade is possible from Syslog Watcher 4.2 or later. 1. Install Syslog Watcher 5.0 Syslog Watcher 5.0 uses own program files location, unique service name, and work folders so that it can be installed along with previous Syslog Watcher 4.x. 2. ...
    • Syslog Watcher 5.0

      What’s New in Syslog Watcher 5.0 Syslog Forwarding We added the syslog forwarding feature in Syslog Watcher 5.0. Syslog Watcher can work as a syslog relay and forward incoming syslog messages to other syslog servers. The syslog forwarding supports ...