Submit a ticketCall us

WebinarUpcoming Webinar: How Help Desk and Remote Support Pays for Itself

Learn how help desk software can simplify ticketing management, allow you to track hardware and software assets, and accelerate the speed of IT support and service delivery. Gain insights on how remote support tools allow your IT team to maximize their efficiency and ticket resolution by expediting desktop troubleshooting, ultimately helping keep end-users happy and productive.

Register here.

Home > Success Center > Network Configuration Manager (NCM) > NCM Documentation > NCM 7.8 Administrator Guide > Ensure compliance to policy rules > Regular expression pattern matching examples

Regular expression pattern matching examples

Table of contents
No headers
Created by Caroline Juszczak, last modified by Melanie Boyd on Jun 03, 2018

Views: 856 Votes: 0 Revisions: 7

Updated: May 31, 2018

The following examples illustrate some of the uses of Regular Expression patterns in SolarWinds NCM:

snmp-server community public

Finds any line that includes the text snmp-server community public. There can be text before and/or after the string on the same line.

service tcp-keepalives-in.*\n(.*\n)*.*service tcp-keepalives-out

Finds the first line service tcp-keepalives-in and then looks for service tcp-keepalives-out on any line after that. The regular expression string .*\n(.*\n)*.* is used to search any number of lines between strings.

access-list 105 deny.*tcp any any eq 139 log

Finds the line with access-list 105 deny, followed by any number of characters of any type, followed by tcp any any eq 139 log on the same line. The regular expression string .* finds any character, and any number of characters on the same line. So, this could be used to find spaces, tabs, numbers, letters, or special characters.

ntp clock-period \d*

Finds any line that includes ntp clock-period followed by any number. The regular expression string \d* will find any number at any length, such as 3, 48, or 2394887.

user \x2a

Finds any line that includes user *. The regular expression string \x followed by a hexadecimal value specifies an individual character. In this example, \x2a represents the asterisk character, which has a hexadecimal value of 2a.

\baccess-list\b.*\bjoe\b

Finds any line that includes access-list and joe. The regular expression \b specifies a word boundary, so the pattern will not find (for example) access-lists or joel. The . matches any character except line breaks, and the * matches 0 or more of the preceding character. Together, the .* allow any number of characters between the two strings, but not line breaks.

 

Last modified

Tags

Classifications

Public