RegEx Text Filter

Navigation:  Widget Designer > Nodes > Filter Nodes > Text Filter Nodes >

RegEx Text Filter

prev main next

Navigation:  Widget Designer > Nodes > Filter Nodes > Text Filter Nodes >

RegEx Text Filter

prev main next

Please wait. Due to its content this page might take a while to load...

The RegEx Text Filter node extends the "Find and Replace" feature known from common text editor software with RegEx expressions. A Regular Expression (short: RegEx) is a pattern that describes a certain combination / amount of text including word, number and (non-) printable characters. By supporting character classes (wild cards), grouping, back-references, etc. the RegEx engine allows very flexible and efficient text processing.
There are different RegEx flavors i.e. implementations in various programming languages. Widget Designer uses the RegEx the .NET framework library.

Below you will find a few examples how regular expressions work. For further information and complete description of supported character classes, operators and constructs, please visit:
https://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx

Note: The Filter node "RegEx Compare" also searches for text that matches the used RegEx but does not replace it, it simply returns a TRUE or FALSE.

wd_nodes_filter_regex-text

Node properties

Input:
Choose an input node from the list or enter a string.

Pattern:
Enter a regular expression describing the text you like to search for.

Replacement:
Enter a regular expression that should replace a found pattern.

Node output values

The node generates the following outputs:
- Output

Examples for Regular Expressions

These examples are based on the input string:
A cat wears 99 hats - What? - Yes, yes!

Pattern

Replace

Output

Meaning

[a-z]+

1

A 1 1 99 1 - W1? - Y1, 1!

Searches case-sensitive any letter from character group "a-z" that occurs at least once. Replaces with digit "1!

(cat)[^\?]*

$1

A cat? - Yes, yes!

Searches for the word "cat" followed by any character that is not a "?" occurring zero or more times. By putting "cat" in round brackets, it became group no.1. Replaces with first group.

[^a-zA-Z0-9 ]

 

A cat wears 22 hats  What  Yes yes

Searches for any character that is not a-z nor A-Z nor 0-9 nor a space. Replaces with nothing.
The mentioned characters can be described shorter with the "character class" word character "\w". Hence, we can search alternatively for the negated group.

[^\w]

\W

(?i)yes

yes

A cat wears 22 hats - What? - yes, yes!

Searches case-insensitive for the word "yes". Replaces with "yes".

For further information and complete description please visit:
https://msdn.microsoft.com/en-us/library/az24scfc%28v=vs.110%29.aspx