Replace module not replacing all matched words in a file

I’m running into an issue with the replace module that I’m not sure how to resolve. When I run the below Ansible code, it generates a config file, but misses the first regexp in my first blockinfile call. All the other lines after the first regexp match work perfectly fine. I tried specifying a carot at the beginning of the ‘\b24x7’ regex pattern to search from the beginning of the file, but that didn’t work. Could someone let me know if I’m missing something?

`