anilmuthineni / foxreplace

Automatically exported from code.google.com/p/foxreplace
0 stars 0 forks source link

How to replace javascript with HTML with Foxreplace #164

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I am trying to replace javascript links in a page to HTML links with 
Foxreplace, but I am having some issues.

Links look like this:

javascript:ViewLink(123)

And I want to change that to:

site.org/links/view_link.asp?LinkID=(123)

Is there a way to do this?

Thanks!

Original issue reported on code.google.com by google...@emailbit.com on 26 Jul 2015 at 7:37

GoogleCodeExporter commented 9 years ago
Why go for foxreplace for this?

Why not do it in any simple text or html editor software with global 
replacement? of course, you could be trying to do something else, and 
selected this odd example to get answers.

Thanks.

Original comment by vsrawat on 26 Jul 2015 at 8:27

GoogleCodeExporter commented 9 years ago
@vsrawat - What a rude and unhelpful response. It's obvious the OP is looking 
to replace this on the go with foxreplace.

Original comment by searchsu...@gmail.com on 27 Jul 2015 at 12:41

GoogleCodeExporter commented 9 years ago
There is nothing rude or offensive.

It is a practical reply.

Foxreplace is primarily for a "character" based replacement, not for 
word or sentence or paragraph or entire-page based replacement. What can 
be done in a jiffy in notepad or wordpad or ms word, why go through all 
these complications in achieving the same in foxreplace?

Thanks.

Original comment by vsrawat on 27 Jul 2015 at 5:17

GoogleCodeExporter commented 9 years ago
You can use a regular expression to do this kind of substitution and you have 
to enable the "Replace URLs" option in the options window. You can use a 
substitution like the following, which would work in this case and with all 
similar links that have a number in parenthesis:

Choose regular expression in the button at the left of the replace field
Replace: javascript:ViewLink(\(\d+\))
With: site.org/links/view_link.asp?LinkID=$1

Original comment by marc.r...@gmail.com on 27 Jul 2015 at 8:18

GoogleCodeExporter commented 9 years ago
In response to vsrawat, FoxReplace is for string or regex-based replacements, 
so words, sentences, paragraphs or entire pages are fine if you know how to 
write the substitution (although there are of course some limitations).

Original comment by marc.r...@gmail.com on 27 Jul 2015 at 8:23