Laravel – Extract last 4 consecutive digits in a string
I want to match/extract the last 4 consecutive digits in a string. The pattern I need to match is therefore [0-9]{4}, but only the last instance of it in the string - if there are any non-numbers in between, it…