Alex Elliott
The internet home of a prospective software engineer
This is my personal blog where I discuss projects that I'm currently working on, work I've recently completed, or write about any topic which has caught my interest in the world of Computing from my studies or from my personal research.
Latest Articles
Expression Editor Update (2)
January 24th, 2010
Since I’ve had some more time to work on Expression Editor recently I thought it was about time I wrote another update for the progress of the project, and some related news that affects it.
From Last Time…
In the previous post I noted a few areas in progress and some that I wanted to look at in the future. So to catch up there, Drag&Drop is generally a bit more reliable and produces slightly neater results but is otherwise unchanged so far, and the new testing widget is still waiting. A significant change has been made in the area of supported regular expression formats however.
The application now has backends for Qt4, PCRE and POSIX ERE formats (though the visualisation could still mess up some PCRE/POSIX elements, let me know if anything breaks). You can select the format you wish to work in from the menu bar, it will be displayed in the bottom right of the screen so you know which mode it is currently in, and the save format has been slightly extended to save your preference for each particular expression.
The default mode has also been changed to PCRE, since it is probably the most powerful backend available. Another minor UI change has been included which is an expression status indicator to the right of the text input. A green tick while valid, and a red exclamation mark when invalid, in addition if you mouseover the invalid indicator, the tooltip is the error returned from the active regular expression backend.
In Related News
As you probably saw above the screenshot used is from Mac OSX. In order to improve my capacity to test Expression Editor I’ve gotten myself a Mac Mini as well as my Slackware Linux laptop. Set up with Synergy+ this means I can simultaneously develop the application in Linux and test it in OSX. One behavioural difference between the two operating systems has already been resolved, so hopefully the application should start behaving much more reliably on OSX as well as Linux from now on.
Expression Editor Update
December 24th, 2009
A fair bit of progress has been made since my last blog entry so I thought I’d note a few things that have landed in the repository and a few things that I intend to add at a later date.
Drag and Drop
Initial support for drag and drop editing has been added. You can now re-order the elements of the expression by dragging an element in the visualisation to one of the valid drop zones (which are automatically highlighted as you can see in this screenshot). With this in place it becomes significantly easier to add the other bits of drag/drop editing I want the editor to support. Eventually as well as reordering (plus the double-click edit dialogs which are also currently included for several elements) I aim to include:
- Drag/drop adding of new elements from the toolbar to the left of the visualisation. This should probably spawn a dialog/wizard and then insert the resulting regular expression element into the current expression.
- Reordering needs more support in the alternatives item, currently there are only valid drop zones to place items inside current alternation branches, and there should be a drop zone allowing the user to drop an element in as a new alternative.
- Possibly a simple “trash” element, which simply accepts the drop, and results in the item being deleted from the scene.
Regexp Formats
As stated in a few places in the application, before the initial release I hope to support PCRE, POSIX Extended and Qt format regular expressions. This means supporting a range of different regexp syntaxes, and intelligently warning when switching between formats if some of the expression cannot be used directly in the new format, it should also offer to try to translate the expression if such a problem exists.
For example, if we’re currently in PCRE mode and we have an expression containing “\w” and we switch to POSIX Extended, this should trigger a warning and then offer to translate, turning “\w” into “[[:word:]]”.
At the moment, the application only supports Qt’s internal format, and I think correctly represents much of what it supports internally. The format is very much like a slightly restricted PCRE format, so Qt/PCRE conversion should be fairly straightforward.
Expression Testing
The editor currently has an element at the bottom of the layout which allows you to test the regular expression for given short strings. This is good for most cases, since it allows you to have a few regexp “unit tests” of sorts, where you test fringe cases and observe if it matches, partially matches, and whether the capture groups work as expected.
In addition to this it would be useful to have a few other methods of testing included. The testing widget should eventually be a tabbed widget with the currently available tester as an option, then also having at least two additional panes. A “bulk text” pane which takes paragraph or longer inputs of text and highlights all instances of that section which are matched by the regular expression, and a “replacement” pane which allows you to input a similar length input to “bulk text”, and apply the regular expression with a given replacement string (which could also be a regular expression).
Anyway, that’s what I’ve been working on and some of what I want to include later. Work goes on.
A New Project
December 7th, 2009
I have recently been working on a new project under the working title of “Expression editor”, an application which allows for easy editing of Regular Expressions (regexps) in a similar way to KDE3.x’s KRegExpEditor. I used to love KRegExpEditor for the incredibly useful functionality it provided, and in particular the visualisation of the regular expression as you edited it. Being able to see graphically what the regexp was doing made dealing with long cryptic regexps much easier, and I felt it was a shame that it was not (as far as I know) ported to Qt4 and KDE SC 4.x.
Since I felt it was a very useful application and one that I felt deserved to be ported to Qt4, I have started my own replacement (I decided to replace it rather than port mostly as a learning experience) written from the ground up in Qt4. If it reaches a good level of stability I may consider porting it to be a KDE SC 4.x application, but for now I’m just focusing on building a working replacement. After working on this for two weeks (start date: 23rd November 2009) I’ve reached a state where things are starting to come together. If anyone’s interested the app is licensed under the GPLv3 and is available from GitHub. Any bugs or feature requests are welcome at the project’s Issues page. As of fairly recently it looks like this:
At the moment it includes some Oxygen icons, but due to the license on those they will be replaced before I release an actual stable version of the application.
Remember, if you do try it, it’s nowhere near stable yet – and a fair bit is yet to be implemented (like the drag and drop / GUI editing of expressions).
Search
Recent Articles
- Expression Editor Update (2)
- Expression Editor Update
- A New Project
- My Little FAQ For PHP Pitfalls
- Musings on Syntax Highlighting for Websites
My Projects
- Expression EditorGraphical Regular Expression Editing Tool
- My Pastebin – PasteSite.ComMy Easy Usable NoPaste/Pastebin Application
Blogroll
- Binary VisionThe Technology Musings of Ed Cradock
- Tim Davies sans vowelsThe Blog of Tim Davies
- WizedAdam McPeake’s Blog
Other Sites
- HideMyAss – Free Web ProxyHide My Ass! Free Proxy and Privacy Tools – Surf The Web Anonymously
- Iam-andy – Design PortfolioThe Design Portfolio of Andy Mallaby
- Zymic – Free Webhosting and MoreFree Web Hosting, Free Templates, Free Tutorials and more! Zymic Webmaster Resources
Archives
- January 2010 (1)
- December 2009 (2)
- November 2009 (1)
- February 2009 (1)
- January 2009 (1)
- December 2008 (1)
- November 2008 (5)
Categories
- arbutus (1)
- c++ (3)
- general (4)
- musing (1)
- php (5)
- polymer (4)
- zbot (3)
- projects (10)
- expressioneditor (3)
- qt (3)
- regular expressions (2)
- web (5)


