can regex recognize an sequence and perform actions based on it?
for example: I need regex to search for $string, then count BASED on x number of characters preceding $string and extract some data.
if anyone help me better word this question or suggest links it would be greatly appreciated!
you are looking for something called lookahead in regex.
For example the regex below will match only if there are 5 to 7 digits before the string
naturally – you will need to replace “string” with your own var.