Top
Systemwalker Runbook Automation Studio User's Guide
Systemwalker

6.4.4 Extract string Filter

This filter extracts strings in the results of an operation component or in filter output that match regular expression patterns.

Regular expression

Enter the regular expression used to extract the string.

The filter will end in an error if the Regular expression field is empty.

The input can be up to 512 characters long.

Point

How to write regular expressions:

Regular expression syntax

Matches

[abc]

Either a, b, or c

[a-z]

Any one lowercase alphabet

[A-Z]

Any one uppercase alphabet

[0-9]

A number between 0 and 9

\d

A number between 0 and 9

.

Any character

.*

Any string

In the syntax of regular expressions, dots (.) match any single character. Use the escape character (\) before the dot when the dot itself needs to be matched (i.e., \.)

Refer to the "Java 2 Platform API Specification" for information on regular expressions not mentioned above.

Use case sensitivity

Select to distinguish between upper and lower case in regular expressions.

The default is to ignore case.

Point

Specifying [a-zA-Z] in Regular expression when Use case sensitivity is selected is equivalent to specifying [a-z] when Use case sensitivity is cleared (see [Example 3] and [Example 4]).

Applications

Select Apply for all to apply the regular expressions to the entire filter input. Select Apply per line to apply row-by-row.

If Apply per line is selected and multiple strings match the regular expression, the extracted strings are output linked by linefeed characters (LF).

The default is Apply for all.

Example 1:

Input:

Ethernet adapter1:[linefeed]
        IP Address. . . . . . . . . . . . : 192.168.238.1[linefeed]
        Subnet Mask . . . . . . . . . . . : 255.255.255.0[linefeed]
        Default Gateway . . . . . . . . . :[linefeed]
[linefeed]
Ethernet adapter2:[linefeed]
        IP Address. . . . . . . . . . . . : 192.168.187.102[linefeed]
        Subnet Mask . . . . . . . . . . . : 255.255.255.0[linefeed]
        Default Gateway . . . . . . . . . : 192.168.187.1[linefeed]

Regular expression:

192\.168\.\d+\.\d+

Match case:

Off

Applications

Applied overall

Output:

192.168.238.1
Example 2:

Input:

Ethernet adapter1:[linefeed]
        IP Address. . . . . . . . . . . . : 192.168.238.1[linefeed]
        Subnet Mask . . . . . . . . . . . : 255.255.255.0[linefeed]
        Default Gateway . . . . . . . . . :[linefeed]
[linefeed]
Ethernet adapter2:[linefeed]
        IP Address. . . . . . . . . . . . : 192.168.187.102[linefeed]
        Subnet Mask . . . . . . . . . . . : 255.255.255.0[linefeed]
        Default Gateway . . . . . . . . . : 192.168.187.1[linefeed]

Regular expression:

192\.168\.\d+\.\d+

Match case:

Off

Applications

Applied row-by-row

Output:

192.168.238.1[linefeed]
192.168.187.102[linefeed]
192.168.187.1[linefeed]
Example 3:

Input:

1[linefeed]
a[linefeed]
A[linefeed]

Regular expression:

[a-zA-Z]

Match case:

On

Applications:

Applied row-by-row

Output:

a[linefeed]A[linefeed]
Example 4:

Input:

1[linefeed]
a[linefeed]
A[linefeed]

RegExp:

[a-z]

Match case:

Off

Applications:

Applied row-by-row

Output:

a[linefeed]
A[linefeed]