I am working with regex with both PHP and JavaScript. So, I was looking for some good tutorial. From this regex tutorial I have found an example for lookbehind that matches a certain 3 digit number only if it is preceded by the the word "USD". There are two different cases where a lookbehind is put both after and before the match.
Here are the regex patterns:
\d{3}(?<=USD\d{3}) //after the match
(?<=USD)\d{3} //before the match
The example string is:
USD100;
I grasped the idea but could not figure what is actually going on inside regex engine to complete the task. Can any one explain it to me easily so that I can understand. Thanks in advance.