Came up with a solution to go through the pattern string and replace all relevant parts but leave out others. (3h work) Tests are passing :)