preg_replace, working on search and replacement values

I have a table with a lot of content that assumes that the site and its subdomains are on http: //

New content is being created with https: // and we do not want to modify old records, but if called, we want to change http to https. Not all links, just those that refer to the site.

so I've
upload_2018-1-26_20-23-59.png "class =" bbImageCodeImage LbImage

I could just set up a table with each subdomain, but I thought it would be more elegant to use preg_replace. What should I use as search and replace values?