Regular Expression Callbacks
| RegEx | Regular Expression Callbacks |
| RegEx_Match | RegExMatch with callback |
| RegEx_Replace | RegExReplace with callback |
| Example | |
| About |
RegEx_Match( ByRef HayStack, Pattern, Fun, Start = 1 )
RegExMatch with callback
| HayStack | Reference to the string to be analysed |
| Pattern | Regular Expression pattern without named sub-patterns |
| Fun | AHK callback. Function must have number of arguments equal to number of sub-patterns + 1. First parameter contains entire match, additional parameters are values of sub-patterns. Function returns true/false to continue/stop matching. |
| Start | Start position |
Number of times callback is called
RegEx_Replace( ByRef HayStack, Pattern, Fun, Start = 1 )
RegExReplace with callback
| HayStack | Reference to the string to be analysed |
| Pattern | Regular Expression pattern without named sub-patterns |
| Fun | AHK callback. Function must have number of arguments equal to number of sub-patterns + 1. First parameter contains entire match, additional parameters are values of sub-patterns. Function returns string that will be used as replacement for current match. |
| Start | Start position |
New haystack
RegExMatch with callback
RegEx_Match( ByRef HayStack, Pattern, Fun, Start = 1 )
RegExReplace with callback
RegEx_Replace( ByRef HayStack, Pattern, Fun, Start = 1 )