How would one go about modifying every occurrence of a particular string in HTML dynamically?
Here's what I'm interested in doing.
Say that you've got a bunch of links like the following:
/cgi-bin/cgifile.cgi?file=2&position=7
And you'd like for each occurrence of these links to be modified to read something like this:
/cgi-bin/cgifile/2/7
Is there a way to modify HTML on the fly so that every occurrence of the first type of a link is modified into the format of the second type of link?
If a file has a whole series of the first type of links, is there anyway to filter the serving process so that the second format is substituted for the first?
Andreas
gecko, is the HTML already on the page, maybe pulled from a db...? If it's in a variable it might be easy-ish to use a little REGEX when needed to strip the query strings you want removed.
Not sure if the REGEX is already in that thread andreas posted, if it isnt, its nearby :)
Amazing, isnīt it. I have been posting these links quite often lately. Now either those bags are already quite full with nice little scripts or people keep asking the same questions ;).
>>REGEX is already in that thread andreas posted
Yes it is. ;)
BTW good luck with your bio-informatics plans, bol. Are you on your way to become the next Lincoln Stein ;)?
Andreas