Using Regular Expressions

There are 2 different ways in which GOFR does pattern matching – either using wild cards (the same thing that Microsoft Office uses) or Regular Expressions.

Wild Cards are simpler but less powerful, we recommend using Regular Expressions. Internally, GOFR converts WildCards to Regular Expressions.

To use regular expressions in GOFR, in the multiple parameter entry page click the Option menu (OPT) next to the text to find or text to replace text box and select “Regular Expressions”. The color of the text input box will change to green.

You can use Regular Expressions to transform the result based on the search pattern. For example, you can transform a pattern of <First Name> <Last Name> to <Last Name> <First Name>, fix number formatting, etc. Definitely take a look at the link below.

We have also put together a help file on transformation here: "Transform Text With Wild Cards and Regular Expressions"

There are many resources online that you can use to understand regular expressions. GOFR uses the .NET regular expressions. We like Microsoft’s page itself, it is very comprehensive:

https://learn.microsoft.com/dotnet/standard/base-types/regular-expression-language-quick-reference

Here is a table of basics to get you started:

Metacharacter Behavior Example
* Matches the preceding character or subexpression zero or more times.
Equivalent to {0,}.
zo* matches "z" and "zoo".
+ Matches the preceding character or subexpression one or more times.
Equivalent to {1,}.
zo+ matches "zo" and "zoo", but not "z".
? Matches the preceding character or subexpression zero or one time.
Equivalent to {0,1}.
When ? immediately follows any other quantifier (*, +, ?, {n}, {n,}, or {n,m}), the matching pattern is non-greedy. A non-greedy pattern matches as little of the searched string as possible. The default greedy pattern matches as much of the searched string as possible.
zo? matches "z" and "zo", but not "zoo".
o+? matches a single "o" in "oooo", and o+ matches all "o"s.
do(es)? matches the "do" in "do" or "does".
^ Matches the position at the start of the searched string. If the multiline option (?m) is placed at the start of the pattern, ^ also matches the position following \n.
When used as the first character in a bracket expression, ^ negates the character set.
^\d{3} matches 3 numeric digits at the start of the searched string.
[^abc] matches any character except a, b, and c.
$ Matches the position at the end of the searched string. If the multiline option (?m) is placed at the start of the pattern, $ also matches the position before \n. \d{3}$ matches 3 numeric digits at the end of the searched string.
. Matches any single character except the newline character \n. To match any character including the \n, use a pattern like [\s\S]. a.c matches "abc", "a1c", and "a-c".
[] Marks the start and end of a bracket expression. [1-4] matches "1", "2", "3", or "4". [^aAeEiIoOuU] matches any non-vowel character.
{} Marks the start and end of a quantifier expression. a{2,3} matches "aa" and "aaa".
() Marks the start and end of a subexpression. Subexpressions can be saved for later use. A(\d) matches "A0" to "A9". The digit is saved for later use ($1 in the text to replace).
| Indicates a choice between two or more items. z|food matches "z" or "food". (z|f)ood matches "zood" or "food".
\ Marks the next character as a special character, a literal, a backreference, or an octal escape. \n matches a newline character. \( matches "(". \\ matches "\".