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.
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 (“"”)
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
Basic Parse Use
Basic Setup (String Matching)
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.
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.
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.