• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

Find and replace in wp_posts table - regex, phpmyadmin?

Joined
Aug 2, 2015
Posts
1
Reaction score
1
Hi Guys,

I have a couple of lines of html that I want to find and replace with another couple of lines. The code appears in a wordpress install in the post_content field of wp_posts. Simple enough - I know how to do it in phpmyadmin using sql or with a couple of plugins. However I want to include a couple of wildcards in the expression that I am searching for. I can't seem to work out how to do it as I'm not good with regex syntax. Can I do it in PHPMyAdmin simply via the search tab for wp_posts?

For example a section of the code I am searching for starts with this;
<p><center><iframe src="http://www.frilly.com/affxml/Home.do?preflang=en&country=france&city=paris

I want to add wildcards for the city and country something like this?
<p><center><iframe src="http://www.frilly.com/affxml/Home.do?preflang=en&country=/(.*?)\&city=/(.*?)\"

Can someone tell me which tree to bark up and hopefully what sort of barking I should try!!?
 
I have actually done something very similar to this before, a few months ago, after following instructions on a stackoverflow post (may want to have a poke around on there via internal search).

Don't ask me how I did it now though. Stackoverflow is probably the best venue for questions like this if you don't get an answer on here.
 
Last edited:
Top Bottom