RegExp-Find

By Richard H. Tingstad Last update May 23, 2010 — Installed 448 times.

it is very easy to add ignorecase search !

in
Subscribe to it is very easy to add ignorecase search ! 2 posts, 2 voices



chfaure User
FirefoxWindows

you could use a mode toggle ie "g" or "ig", "gi" does not works !

I added also a toggle key ([ctrl]+[shift]+I ) to call a toggle function :

var mode = "g" ;
function regToggle(){
var oldmode = mode;
if ( mode == "g" ){
mode = "ig" ;
}else{
mode = "g" ;
}
alert("Mode is ("+oldmode+" => "+mode+") !");
}

and replace your lines :

var regex = new RegExp("(" + s + ")", "g");
--by--
var regex = new RegExp("(" + s + ")", mode);

and

reg = new RegExp("(^|<[^>]+>)([^<]*" + s + "[^<]*)($|<[^>]+>)", "g");
--by--
reg = new RegExp("(^|<[^>]+>)([^<]*" + s + "[^<]*)($|<[^>]+>)", mode);

 
Richard H. T... Script's Author
OperaX11

Of course, you are correct. Thanks for the tip! I have updated the script. One can now change between case sensitive and case insensitive search by pressing Ctrl + Shift + M for Mode. Ctrl + Shift + I is already used in Opera for bringing up developer tools. M should be free. http://support.mozilla.com/en-US/kb/Keyboard+sh... http://help.opera.com/Windows/9.50/en/keyboard....

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel