View Single Post
Old 06-09-2016, 08:06 AM  
klinton
So Fucking Banned
 
Industry Role:
Join Date: Apr 2003
Location: online
Posts: 8,766
there is one wordpress plugin called "search regex" which is handful for me.
yesterday I used it to bulk modify all posts that contained some url like url.com/variablehere to steadyurl.com
I did it using some PHP magic delimiter like
Code:
/<a [^>]+>/i
which basically searched for all urls in posts, marked them and changed them to my new url, specified before in the plugin field "replace with"...
now, my queston is: what would be PHP delimiter to mark whole text in that plugin and later modify it with adding just
Code:
<a href="http://www.myurl.com">
at the beginning.
is it even possible ?
I prefer to use that plugin instead of php my admin somehow, it has safe option like just "search" "search and replace without saving" and so on
Quote:
Originally Posted by sarettah View Post
I am not sure what you are asking. I understand regex, I understand php, I even understand your wildcard using DOS. But I do not understand how you are thinking to use regex when changing posts.

The posts are in a database so they either have to be changed while they are going in or when they come out (being displayed).

I do not see either of those requiring regex although if you modified the php being used to display the posts as they come out you could use regex in there but there are other ways to do it too.

What are you wanting the regex to match to? Meaning, are you changing things conditionally (as I described above where one goes to cams and the other to chaturbate) or is everything going to link to the same thing or what?

Sorry for seeming dense.

.
klinton is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote