Question

Related to this question: Create a new jquery chained method, how do I do an advanced find and replace in Visual Studio (or even Notepad++ or something else) to find:

Foo($("selector"));

And replace with:

$("selector").foo();

This is because I've created a new jQuery chained method:

$("#SaveButton").click(function () {
    $("#SubTotal").foo();
    $("#TaxTotal").foo();
    $("#Total").foo();
});

To replace this

$("#SaveButton").click(function () {
    Foo($("#SubTotal"));
    Foo($("#TaxTotal"));
    Foo($("#Total"));
});

And now I need to find and replace all instances of the old method call with the new chained method.

No correct solution

OTHER TIPS

Use regular expressions in the Find options of Find/Replace dialog.

Hope that helps.

NB: I run screaming madly at the mere notion of having a stab at your particular expression but it is really just a transform of a number of matches so should be doable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top