Grant Skinner

The "g" in gskinner. Also the "skinner".

@gskinner

RegExr Desktop Released: Regular Expression Tool in AIR

I just uploaded the desktop version of RegExr. It’s just an AIR version of the online application for now, but I’ll add some desktop specific features, and put up a nicer looking page when I have a chance.

With this morning’s announcement of the AIR alpha for Linux, this means RegExr is now the first free tool for editing and testing regular expressions (RegEx) that runs on Mac OSX, Windows, Linux, and online (as far as I can determine). Pretty cool, considering it only took 60 minutes of work to convert the online application to a desktop program and add update notifications.

You can install the desktop version of RegExr here. Or, you can use the online version at regexr.com.

Next up, I plan to add support for testing replace functions, and then a proper lexer.

Update to RegExr: Learn and Test RegEx Online

I just released a new version of RegExr, the free online application for learning and testing regular expressions. This release includes a number of minor bug fixes, and a few big new features.

Real-time expression editing

Matches are now displayed in real-time as you edit your expressions.

Code sense

This build has early support for displaying inline code tips when you mouse over your expression.

Infinite match notification

The expression will now turn red if it will result in infinite matches.

New URL

You can now access RegExr at RegExr.com. This simply redirects to its permanent home at gskinner.com/RegExr/.

If you encounter any problems, have a feature request, or want to provide feedback, please leave a comment below.

Known issues:

The group pre-parser doesn’t do a very good job with nested groups. This only affects the group listing in the info field (bottom), not code sense or the groups listing for matches.

Code sense support is very early, and will likely have some quirks. Please let me know of any issues in the comments below.

RegExr: Free Online RegEx Testing Tool

RegExr is an online tool for editing and testing Regular Expressions (RegExp / RegEx). It provides a simple interface to enter RegEx expressions, and visualize matches in real-time editable source text. It also provides a handy RegExp snippet sidebar with descriptions and usage examples to make it easier to learn Regular Expressions through trial and error.

It isn’t as powerful as a product like RegExBuddy, but it has the advantage of being online and free. I will be releasing a free desktop version for Mac OSX and Windows built with AIR in the next day or two.

So far this has only taken a day of development, and the main app is only 150 lines of code. Flex 3 makes this kind of app so darn simple to put together.

RegExr is built with Flex 3, and uses ActionScript 3’s built in RegExp engine. As with most engines, the AS3 RegExp implementation isn’t perfect, so you are likely to encounter some limitations and oddities. Likewise, RegExr is very much beta software (did I mention it was developed in a day?), and currently has no error handling whatsoever, so it’ll probably have a few quirks of its own.

RegExr uses an extension of the TextHilighter class that comes with the Spelling Plus Library. We will be including the RegExpHighlighter class with a future release of SPL.

Continue reading →

Adding CSS Support to the CS3 Components

The CS3 component architecture makes use of TextFormats for all the text-styling needs. This decision was (likely) made to simplify the API, but still allow full control over the formatting of the text.

Natively, there is zero support for CSS styling, in fact, setting a styleSheet on the textField of a component (all components expose their textField instances) results in a run-time error, since TextFormats can not be set on textFields with a styleSheet.

But fear not! Not only are the components easy to extend, but it is not at all difficult to add CSS support to any component. In this example, I have added a styleSheet component style to a TextArea, which plays nicely with the built-in TextFormat. Rather than just posting the source code, I have broken down how the implementation works to provide some insight on how the components work, and how this sort of approach can be applied to any component, for almost any task.

Continue reading →