how to replace a big string in file using ansible

Hi

I have string in a file that contains lot of special characters. how to replace that string using ansible modules.

From

$base_url = ‘http://’ . $_SERVER[‘SERVER_NAME’];

To

$base_url = ‘http://server1.abc.com’;

Can some one help on this.

Thanks
Dev

It depends on the rest of the file but if that's the only line starting with $base_url you can do something like this
   - name: Replace line
     lineinfile:
       dest=/tmp/filename
       regexp='^\$base_url = '
       line="$base_url = 'http://server1.abc.com';"