by DaleStan » Sun Jun 20, 2010 1:44 pm
So, I am also trying to use CYW as a replacement for platypus, and I can't find the "execute arbitrary regex" option, nor a workable alternative.
There is (I believe) a reliable XPath to a page element that, if I can type my regexes correctly, matches the case-insensitive regex
/(\<img.*?src="(http.*?)_thumb(\.((jpg)|(jpeg)|(gif)))".*?\>/
(an IMG tag where the filename of the source ends with _thumb)
Once I find that element, I want surround it with an href as so:
"<a href=\"$2$3\">$1</a>"
(Turn the image into a link to the image, but without _thumb)
I can find the "Insert HTML" option, but it does not have any mention of any way to use the content of the element (to wit, the src attribute) to decide what HTML to generate.[0] Insert Javascript is even worse; I can't figure out how to insert an onclick action at all, much less an onclick action that does different things depending on an attribute of the element being modified.
So: Is this even possible with CYW? If so, what option should I be using, and/or what terms should I have searched for in the wiki? regex and "regular expression" both returned no results.
[0] It also doesn't have the unnecessary but reassuring "Insert around" or "Surround with" options