Today, I found myself looking for a regular expression that matches only the last occurrence of a given expression.. As I’m still not a regex mastermind I couldn’t come up with it just like that.. The key to the solution is a so called “negative lookahead“ A lookahead doesn’t consume characters in the string, but only asserts whether a match is possible or not. 5ebbf469cd