Java does Regular Expressions

I don’t think I’ll be using my IllustRender plugin too often— the effort required is such that I will either have to be working on a well-planned post, or have gained a lot more familiarity with MetaPost and Postscript than I currently have. Even taking those factors into consideration, it seems like it would be annoying to have to save the post every now and again while working on it, simply to check that an illustration is developing as planned. So I wrote a utility (in Java) along with a simple extension to the plugin that lets you enter the code in it, and shows the results that IllustRender would give, minus the overhead of the browser. You can save and load code too. The idea is that you use this utility to develop the code on your desktop, then put the finished code into your entry. I just had the thought of implementing cut and paste (don’t know why I’m now thinking of it)— but I think Java automatically supports that— if not, I’m sure it won’t be too hard to handle. I’m going to finish testing it, and then add it to the plugin.

Java supports regular expressions automatically! I had always thought that you had to download third party libraries for that; and maybe you did, in JDKs before 1.4. But apparently, Sun added an API for regexps (Perl style!) in the package java.util.regex. Until I discovered that this morning, I was debating whether to hand code any future finite state automata I might need for regular expression parsing tools, to maintain a nice portable and self contained code base, or to be lazy and find a third party library. After checking out the section of the Java Tutorial on the java.util.regex package, however, looks like I can accept no compromises. Now, I can tackle one of those projects I always have on the backburner: an XBEL, multi-browser capable, cross-platform, user friendly, extensible, small footprint bookmark manager. Of course, there are already a ton of projects to create bookmark managers which have several of these features, but none of the ones I’ve encountered have all. It’s either that they must be installed instead of simply ran from the desktop, are not cross-platform, are unreasonably large, are not easily extensible (I don’t want to have to hack the core code), are not user friendly (please, give me a more flexible GUI than the bookmark manager in Opera and IE— at the least, one on par with Firefox, but even that can be improved), don’t support XBEL, can’t auto-upload/-download to a specified location, don’t export back to the browsers that the bookmarks were imported from, or aren’t free.

I think Java is an ideal tool for the job, now that I see it has regexp support. Swing can handle the GUI stuff, and there are APIs out there for using XML with Java that I can look into. The handling of specific browsers can be done via a plug-in architecture, which judging from this article will be a breeze to implement.

Possibly relevant posts:

Jan 8th, 2005 | Posted in Programming
Tags:
  1. Feb 25th, 2007 at 00:46 | #1

    And… like a dumbass I didn’t store the code for that Illustrender frontend somewhere safe, and now I want it, I can’t find it. Of course, I haven’t used Java in forever, so I can’t exactly roll it off again. Serves me right. I should have uploaded it and linked to it.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">
CommentLuv Enabled