Generally regex works left to right but sometimes needs to process the text right to left.
Processing text right to left is called lookaround.
example : Needs to insert coma after three digits in cash
12,345,678