Argument | Description |
as_pattern | String. The regular expression pattern to match |
as_replace | String. The replace (substitution) pattern to replace matches with |
as_data | String. The input string of data you wish to perform regular expression search/replace operations on |
al_start | Long. The starting position in which to apply the regular expression search pattern. Use 1 to start at the first character |
al_occur | Long. The number of search and replacements you would like to perform. To perform all possible replacements, use 0. To perform only a single search and replacement, use 1, etc. Note that this parameter is different from the other RegEx3 functions in that it specifies how many times to do a search and replace operation rather than specifying to do a search and replace only on a particular occurence. |
ai_flags | Integer. A flags parameter that controls how the regular expression is performed |
ai_localstart | Integer . The index of a local variable in which to store the start of data that is matched and replaced 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. This parameter is ONLY relevant if the al_occur parameter is 1. Any other value for al_occur will return a 0 in the specified LOCAL variable |
ai_locallength | Integer . The index of a local variable in which to store the length of data that is matched by the regular expression before replacement. 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. This parameter is ONLY relevant if the al_occur parameter is 1. Any other value for al_occur will return a 0 in the specified LOCAL variable |
ai_localreplength | Integer . The index of a local variable in which to store the length of the replacement data that was performed by the regular expression. Use 1 thru 10 for [LOCAL1] thru [LOCAL10]. If you don't want the replacement length of matched data stored in a local variable, use 0. This parameter is ONLY relevant if the al_occur parameter is 1. Any other value for al_occur will return a 0 in the specified LOCAL variable |
This function is useful for search and replacement using regular expressions when you want a finer level of control instead of just performing a brute force search and replace ALL using the ph_replaceallregex3( ) function. You can still achieve the same effect as ph_replaceallregex3 by setting the al_occur parameter to 0 albeit you'll have to supply all the other parameters required by this function
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