I am trying to figure out the following regex expression and why it gives me the result I get.
I have the following javascript:
let result = '7979797'.replace(/797/g,'77');
I would expect the result to have a value of 7777, but instead it has a value of 77977.
I was hoping someone could explain why I get the value 77977, and that I will need to change to regex so that it replaces all lines that have from 797 to 77.
source share