Prev: FAQ Topic - Why doesn't the global variable "divId" always refer to the element with id="divId"? (2010-06-10)
Next: Dynamically Creating Checkboxes
From: stevewy on 11 Jun 2010 07:00 On 11 June, 11:55, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid> wrote: maybe : onclick="([^"]|\s)*" No, it doesn't do anything with that string. But thanks for the input. Steve
From: SAM on 11 Jun 2010 08:06 Le 6/11/10 1:00 PM, stevewy(a)hotmail.com a �crit : > On 11 June, 11:55, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid> > wrote: > maybe : > > onclick="([^"]|\s)*" > > No, it doesn't do anything with that string. Sorry, that works fine in my text editor. Rest to use a JS tool ? <form onsubmit="return doIt(this)"> <div> Enter your code here :<br> <textarea name="txt" cols=80 rows=16></textarea><br> Search: <input name="fSearch"><br> Replace: <input name="fReplace"><br> <input type="submit" value="replace all"> <input type="reset" onclick="restitue(this)"> </div> </form> <script type="text/javascript"> var memoriz = ''; function doIt(where) { var f = where.fSearch.value, r = where.fReplace.value, t = where.txt; if(memoriz=='') memoriz = t.value; var rg = new RegExp ( f, 'ig'); t.value = t.value.replace(rg,r); return false; } function restitue(what) { setTimeout( function() { if(memoriz!='') what.form.txt.value = memoriz; memoriz = ''; },10); } </script> -- sm
From: stevewy on 11 Jun 2010 08:43 On 11 June, 13:06, SAM <stephanemoriaux.NoAd...(a)wanadoo.fr.invalid> wrote: > Rest to use a JS tool ? Thanks, I'll keep that code and try it if the Notepad++ semi-solution proves too tedious. Steve
From: Dr J R Stockton on 12 Jun 2010 14:52 In comp.lang.javascript message <b60bba22-da8f-4437-baca-ffbe23c8b5e9(a)z1 0g2000yqb.googlegroups.com>, Thu, 10 Jun 2010 09:14:52, stevewy(a)hotmail.com posted: >I'm just trying to work out (if what I want is at all possible), a >regular expression that will search for and select (in a text editor >that supports regexps, like Notepad++) the word "onclick", then any >text at all, up to and including ">". How "like" must it be? MiniTrue will do it, at least at the XP 32-bit command line (CMD.EXE) : PROMPT>mtr $1.htm "onclick[^^]*>" The character ^ is a command-line escape, so only the second one counts; [^] thus means to search for not nothing, which, at least in MiniTrue, is a more potent "anything" than a mere dot is. You could see if that works in Notepad++. Or in JavaScript. MiniTrue is not a full interactive editor, but it can do substitutions. -- (c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 7. Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Command-prompt MiniTrue is useful for viewing/searching/altering files. Free, DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
From: stevewy on 13 Jun 2010 06:17
On 12 June, 19:52, Dr J R Stockton <reply1...(a)merlyn.demon.co.uk> wrote: > MiniTrue will do it, at least at the XP 32-bit command line (CMD.EXE) : > > PROMPT>mtr $1.htm "onclick[^^]*>" Thanks, John. I have downloaded the zip file of the Minitrue executable and will try it out when I get back to the office next week. Thanks for the info. Steve |