Forum:Bot search and replace

I'd like to replace all links in a wiki that look like this *PAGENAME at Tolkien Gateway with a template looking like this * The structure is always the same, but PAGENAME differs. Is that possible using AWB or Pywikipediabot? If so... how?

Thanks for your help. -- Weas-El ✉  15:02, November 3, 2011 (UTC)


 * At least for the template call, you should use the magic word . AWB may be able to do it, Pywikipedia could definitely have a script written for it that would allow it to perform that action if it doesn't already have the capability.


 * You could likely use AWB with a regular expression in order to express PAGENAME or at least to capture it in the find. Not sure on what it is you would use though.--


 * "PAGENAME" probably was a bad choice for my parameter name. This is just the name of the linked page, but not necessarily equal to.
 * @Godisme: How could that regex look? The expressions don't have the same length... -- Weas-El ✉  15:15, November 3, 2011 (UTC)