andrew.reid at plug.cx
Sun Jun 5 23:26:18 CST 2005
I'm sure this is dead simple, but I can't see it for the life of me.
Never was any great shakes at regexes...
I've got a little servlet that's meant to do a search-and-replace on
HTML files. Specifically, it's meant to replace the src attribute of
the img tag.
So, something like:
The problem that I'm encountering at the moment is that the slashes
are being treated by the regex engine as an escape statement. That
gives me results like:
In other words, it's taking the slashes to be escape commands. I'm
just using the replaceAll method from the String class:
fileContents.replaceAll("src=\"", "src=\"SendFile?file=" + basePath);
How'd you recommend I go about this?
| Andrew Reid [andrew.reid at plug.cx]
| Overworked and Underpaid Network Monkey
| C: +61-401-946-813 F: +61-8-8338-2518
More information about the linuxsa