use compiled regex for up to 10 placeholders, and generate dynamically
otherwise