[TxMt] a regexp test script (link)

Robert Ullrey robert_ullrey at mac.com
Mon Apr 4 22:04:38 UTC 2005


-----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.
> <html><head></head><body>
> <h3>Results for  
> /(http|https|ftp):\/\/(([-_a-zA-Z1-9]+)\.)+([-_a-zA-Z1-9]{2,3})/</ 
> h3><tt>
> <b><font color="Red"></font></b><b><font color="Dark  
> Blue">http</font></b><b><font color="Red">://www.</font></b><b><font  
> color="Dark Purple">google.</font></b><b><font  
> color="Red"></font></b><b><font  
> color="Brown">google</font></b><b><font  
> color="Red">.</font></b><b><font  
> color="Burgundy">com</font></b><b><font color="Red"></font></b>
> <br/><b><font color="Red"></font></b><b><font color="Dark  
> Blue">https</font></b><b><font  
> color="Red">://www.netbank.</font></b><b><font color="Dark  
> Purple">com.</font></b><b><font color="Red"></font></b><b><font  
> color="Brown">com</font></b><b><font color="Red">.</font></b><b><font  
> color="Burgundy">au</font></b><b><font color="Red"></font></b>
> <br/><b><font color="Red"></font></b><b><font color="Dark  
> Blue">ftp</font></b><b><font color="Red">://</font></b><b><font  
> color="Dark Purple">mafia.</font></b><b><font  
> color="Red"></font></b><b><font color="Brown">mafia</font></b><b><font  
> color="Red">.</font></b><b><font  
> color="Burgundy">ru</font></b><b><font color="Red"></font></b>
> <br/>www.clickstart.com
> <br/>boozehound
> <br/>gary sweeney
> <br/><b><font color="Red"></font></b><b><font color="Dark  
> Blue">http</font></b><b><font color="Red">://www.</font></b><b><font  
> color="Dark Purple">amazon.</font></b><b><font  
> color="Red"></font></b><b><font  
> color="Brown">amazon</font></b><b><font  
> color="Red">.</font></b><b><font  
> color="Burgundy">com</font></b><b><font color="Red"></font></b>/
> <br/><b><font color="Red"></font></b><b><font color="Dark  
> Blue">http</font></b><b><font color="Red">://www.</font></b><b><font  
> color="Dark Purple">amazon.</font></b><b><font  
> color="Red">com/exec/obidos/subst/home/home.html/002-0270779-6</ 
> font></b><b><font color="Brown">amazon</font></b><b><font  
> color="Red">.</font></b><b><font  
> color="Burgundy">com</font></b><b><font  
> color="Red"></font></b>/exec/obidos/subst/home/home.html/002-0270779 
> -6984007
> <br/></tt></body></html>
>
> -- 
> Eric Hsu, Assistant Professor of Mathematics
> San Francisco State University
> erichsu at math.sfsu.edu
> http://math.sfsu.edu/hsu
> ______________________________________________________________________
> For new threads USE THIS: textmate at 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-----




More information about the textmate mailing list