Properly escape curly brackets in regex pattern to avoid warnings