Argument | Description |
as_pattern | String. The regular expression pattern to search and snap data |
as_snap | String. The snap pattern that dictates how the snapped data is returned. Use an empty string "" to just return all matches concatenated together |
as_data | String. The data you wish to perform the regular expression search and snap on |
al_start | Long. The starting position in the data at which the regular expression search will start. Use 1 to start searching at the beginning |
ai_occurence | Integer. The occurence of the particular data you wish to match. In a given as_data string, there may be multiple matches for a particular regular expression search. This parameter allows you to define which particular matching instance you would like to work with. Use a value of 1 to use the first instance. To return ALL instances, use a value of 0 |
ai_flags | Integer. A flags parameter that controls how the regular expression is performed. See Usage below for details |
ai_localstart | Integer. The index of a local variable in which to store the start of data that is matched by the regular expression. Use 1 thru 10 for [LOCAL1] thru [LOCAL10]. If you don't want the start position stored in a local variable, use 0 |
ai_locallength | Integer. The index of a local variable in which to store the length of data that is matched by the regular expression. Use 1 thru 10 for [LOCAL1] thru [LOCAL10]. If you don't want the length of matched data stored in a local variable, use 0 |
To extract (or "snap") portions of a regex match, a "capturing" group is specifed in the as_pattern parameter. A capturing group is defined by enclosing the portion of the regular expression search you wish to capture in open "(" and close ")" parenthesis. To specify how the extraction is built into the return string, the as_snap pattern allows you to reference the capturing groups (numbered from left to right in the order that they appear in as_pattern starting with 1) by prefixing the capture group number with a dollar sign "$" character. You can also include additional text to separate or otherwise delimit the captured entries. A simple snap pattern to return the #1 capture group with a colon surrounded by space characters as a delimiter would be: "$1 : "
The ai_flags parameter controls how the regular expression search is done. The value for each desired option below would be added together to arrive at the proper ai_flags value. If none of the additional options are required, then use an ai_flags value of 0. For a detailed explanation of eachof the options, see this link: https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regexoptions?view=netcore-3.1