Use a Pattern Match Step

The Pattern Match step allows you to define a sequence of characters to search for across your data sources. When the step finds matches for the defined pattern, it collects other information related to results from the search query for you to use in future steps.

Pattern Match vs Filter

The Filter step allows you to filter data based on logical conditionals. If data does not meet the conditional statement based on the filter, the workflow will not continue.

The Pattern Match step is used to match a specific format of data and then define this format as a variable. This data will be matched against regex. Another major difference between Filter and Pattern Match is that the workflow will continue even if the match is not successful.

Regular Expressions

The patterns you search for are formatted as "regular expressions," or regex.

Acceptable patterns can be custom regex you write, or patterns in the following "match variable" types:

  • IPv4
  • URL
  • Domain
  • Email

InsightConnect supports Google's RE2 regex language.

What's the difference between regex and string literals?

Strings, or string literals, are sequences of characters that are typically read and processes as-is, with no formatting. For example, the string "Hello, world!" would be read as a string of thirteen characters including ten letter characters, two punctuation characters, and one space.

Regex is far more powerful, and encompasses strings. You can certainly use pattern match steps to search for basic text strings, but with regex you can search for patterns as wild as you can design with regex syntax.

Configure the Step

  1. Name the step. We recommend using a description of the pattern you're using as the name.
  2. In the "Match Input" field, click the + and choose data sources you'd like to search for your pattern in.
    • You can also paste in a block of raw text to search for your desired pattern in, but you must include at least one variable.
  3. Enter the pattern you'd like to use to match against input data in the 'Against' field.
  4. Check the respective boxes if you want case-insensitive search or to capture all matched results.
  5. Click Continue to save.

Format Match Variables

A match variable is the pattern that the input is compared against. Format 'match variables' using the following notation for custom regex: {{<variable name>:/regular expression/}} Or use this notation for built-in match variable types, by replacing <built in type> with "ipv4", "domain", "email", or "url": {{<variable name>:<built in type>}}