From erichsu@math.sfsu.edu Mon Apr 4 21:37:40 2005 From: Eric Hsu To: textmate@lists.macromates.com Subject: Re: [TxMt] a regexp test script (link) Date: Mon, 04 Apr 2005 14:31:45 -0700 Message-ID: In-Reply-To: <4128b41fc335ff5dcef6b2accd8219fe@davelee.com.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0871924291018696279==" --===============0871924291018696279== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I've written an alternative version of the regular expression=20 checker. It relies heavily on a script I found on the web by=20 Aristotle at perlmonks.org (cited in the code). I've checked it into the svn repository. There's also a version of=20 the Ruby script that produces a tooltip (though I can't get that to=20 work on my computer yet). They live at=20 http://macromates.com/svn/Bundles/trunk/RegularExpressions.tmbundle/ The way this alternative works is you copy the regexp to the=20 clipboard, then highlight the text you want to check. Then it=20 produces HTML output which color codes each subcapture. There might be a nicer way to grab the regexp, like maybe using=20 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=20 /(http|https|ftp):\/\/(([-_a-zA-Z1-9]+)\.)+([-_a-zA-Z1-9]{2,3})/

http://www.google.google.com
https://www.netbank.com.com.au
ftp://mafia.mafia.ru
www.clickstart.com
boozehound
gary sweeney
http://www.amazon.amazon.com/
http://www.amazon.com/exec/obidos/subst/home/home.html/002-0270779-6amazon.com/exec/obidos/subst/home/home.html/002-0270779-6984007
--=20 Eric Hsu, Assistant Professor of Mathematics San Francisco State University erichsu(a)math.sfsu.edu http://math.sfsu.edu/hsu --===============0871924291018696279==--