Top
Top
LibraryEASYProcess Reference ManualProcessesServicesRegularExpressionWorkshopParse

Parse Overview

Parse is used to evaluate an input string using regular expressions.  This is useful for searching and interpreting strings during processing.

A regular expression is a series of characters that define a set or subset of strings or substrings.  They are often used for searching for a specific substring pattern within a given string.

Regular expressions within EASYProcess conform to the .NET standard for regular expression syntax; as described in the Microsoft Docs’ .NET Framework for Regular Expressions.

When run, the service will attempt to match the input string against each defined regular expression pattern.  The ordering of regular expression patterns in input does not impact processing in any way and will simply change the ordering of the service’s non-static output nodes; which will always appear in the same order that the patterns were defined in.

Custom Output Nodes

Named capturing groups can optionally be used inside of the regular expression patterns to define custom output nodes.  These output nodes will have the same name as the named capturing group.  The value of each of these nodes will be that value that was captured by the group which caused the node to be generated; with surrounding whitespace removed.

Special Characters

Certain processing options for this service deal with special characters.  Those special characters are defined as follows:

  • Escaped angle brackets (“<” and “>”)
  • Escaped apostrophes (“'”)
  • Escaped quotation marks (“"”)

Exception Handling

If an exception occurs for any of the defined patterns, then processing will stop and further output nodes will not be generated.  This can be useful for determining the cause or timing of an error, when troubleshooting.


Parse Use Examples
Developer Notes: RemoveSpecialCharacters
Workshop:RegularExpressionWorkshop
Service:Parse
Inputs
InputThis is the string value that you are going to parse with one or more regular expressions.

RemoveSpecialCharactersThis optional processing flag is only applicable for custom output nodes. If this flag is true, then any captured input will have special characters within it replaced with space characters. If this flag is not defined, then it assumes a default value of false.

PatternsThis is the container node that contains all the Pattern nodes. It does not accept any input, but you can Right-Click to add new Patterns (Pattern#0, Pattern#1, etc.). Each Pattern below this node is matched, in sequence, with the Input as a regular expression when this service runs.

PatternThe Pattern is a container node which accepts no input, but represents a single regular expression you are attempting to parse the Input with.

ValueThis is a regular expression you are attempting to parse the Input with. This regular expression can be any valid .NET regular expression. Using named capturing groups inside of your regular expression will cause the service to define custom output nodes.

Outputs
InputThis is the string that the service received as its Input node; appearing as interpreted at the start of the service's internal execution.
MatchedThis will be a value of "True" or "No", depending on whether or not any Pattern was able to be matched with the Input node's string.
MatchedPatternThere should be a number of these output nodes equal to the number of Patterns that you defined. Each of these nodes will correlate in a 1:1, sequential manner with your defined Patterns and will contain the interpreted regular expression string for the Pattern that it correlates with. These nodes will interleave with any custom output nodes created by named capturing groups such that the custom output nodes generated by a specific Pattern will appear directly between the MatchedPattern node for that specific Pattern and the MatchedPattern node for the next Pattern (if such a following Pattern exists).

Parse Use Examples

Basic Parse Use

Basic Setup (String Matching)

Process Structure

Parse Service Input

Parse will take the data from input fields on the web page and process it.

Then the process will set the output field on the web part.

Custom Output

To generate the custom output node, we add a named capturing group to our regular expression.

In the logs, we will be able to see the custom output node that was generated by running the process.


Remove Special Characters

First, we must edit our Parse service by enabling the flag to remove special characters.

Now any custom output nodes that are captured will have their special characters replaced by single space characters.


Developer Notes

RemoveSpecialCharacters

If the data source for the Input node of Parse will contain only unescaped special characters, then you can use the function EASYProcess:HtmlEncode(...) to escape the characters before they are given to Parse.  For further information, see the documentation for this function.


Powered by EASYProcess (© 2019 K-Rise Systems, Inc).