From robert_ullrey@mac.com Mon Apr 4 22:04:57 2005 From: Robert Ullrey To: textmate@lists.macromates.com Subject: Re: [TxMt] a regexp test script (link) Date: Mon, 04 Apr 2005 15:04:38 -0700 Message-ID: <180503371688d2e9c85348149f3325c0@mac.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6820598393557574521==" --===============6820598393557574521== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Very nice. Thank you for the bundle. Robert On Apr 4, 2005, at 2:31 PM, Eric Hsu wrote: > I've written an alternative version of the regular expression checker. > It relies heavily on a script I found on the web by Aristotle at > perlmonks.org (cited in the code). > > I've checked it into the svn repository. There's also a version of the > Ruby script that produces a tooltip (though I can't get that to work > on my computer yet). They live at > http://macromates.com/svn/Bundles/trunk/RegularExpressions.tmbundle/ > > The way this alternative works is you copy the regexp to the > clipboard, then highlight the text you want to check. Then it produces > HTML output which color codes each subcapture. > > There might be a nicer way to grab the regexp, like maybe using > Cocoadialog, but I just wanted to get this out there. > > > best wishes, Eric > > ps. Here's what you get with the sample file David Lee posted: > > CLIPBOARD > (http|https|ftp):\/\/(([-_a-zA-Z1-9]+)\.)+([-_a-zA-Z1-9]{2,3}) > > INPUT > http://www.google.com > https://www.netbank.com.au > ftp://mafia.ru > www.clickstart.com > boozehound > gary sweeney > http://www.amazon.com/ > http://www.amazon.com/exec/obidos/subst/home/home.html/002-0270779 > -6984007 > > > OUTPUT. > >

Results for > /(http|https|ftp):\/\/(([-_a-zA-Z1-9]+)\.)+([-_a-zA-Z1-9]{2,3})/ h3> > http://www. color="Dark Purple">google. color="Red"> color="Brown">google color="Red">. color="Burgundy">com >
https color="Red">://www.netbank.com. color="Brown">com. color="Burgundy">au >
ftp:// color="Dark Purple">mafia. color="Red">mafia color="Red">. color="Burgundy">ru >
www.clickstart.com >
boozehound >
gary sweeney >
http://www. color="Dark Purple">amazon. color="Red"> color="Brown">amazon color="Red">. color="Burgundy">com/ >
http://www. color="Dark Purple">amazon. color="Red">com/exec/obidos/subst/home/home.html/002-0270779-6 font>amazon color="Red">. color="Burgundy">com color="Red">/exec/obidos/subst/home/home.html/002-0270779 > -6984007 >
> > -- > Eric Hsu, Assistant Professor of Mathematics > San Francisco State University > erichsu(a)math.sfsu.edu > http://math.sfsu.edu/hsu > ______________________________________________________________________ > For new threads USE THIS: textmate(a)lists.macromates.com > (threading gets destroyed and the universe will collapse if you don't) > http://lists.macromates.com/mailman/listinfo/textmate > -----BEGIN PGP SIGNATURE----- Version: PGP 8.1 iQA/AwUBQlG6A2O1AQX/YDblEQKtxwCg1n3WgkW2/wghXFcevVMGW7Oip9YAmgNx 50TiNBIpK4PPBhT6II3sRgAc =qJnv -----END PGP SIGNATURE----- --===============6820598393557574521==--