Omnibus RegEx–HTML UI Experiment in Alteryx

imageYou can download the new tool here.

I have spent a couple of days understanding the methods of the new Formula UI in Alteryx. Based on this I have put together a new UI of the RegEx tool. Leveraging off some of the parts of the Formula tool it supports a preview and syntax highlighting. It is all built on top of the same React components and functions as the other new UIs in version 11. The result are evaluated using the same AlteryxRegEx function in the core AlteryxBasePluginsEngine.dll

Please note, this is based on the undocumented API used by the formula tool so while it works in 11.0 there are no promises of it working in the future versions (and it doesn’t work in older versions). I plan to document up all the workings of this in a later post as well as how I put this together.

Currently, only 3 of the 5 output methods are supported by my UI:

  • Match – evaluates to True / False in a new field. Supports Error if not matched.
  • Replace – uses a second expression to update input field
  • Split to Rows – Tokenise mode splitting into rows

The remaining methods, Split to Columns and Parse, will be implemented in a later update.

The preview is a combination of the same technology as the formula tool (calling back into Alteryx to get the value of the first row) and JavaScript’s built-in regular expression functions (I build a prototype calling through to the formula’s preview system but then changed my mind as had too many issues). This does mean I don’t guarantee the preview is 100% accurate but should make it a lot easier to write the expressions.

In addition, I wanted to have syntax colouring on the Regular Expression. The formula tool uses CodeMirror behind the scenes, so it felt in keeping to use it as well. Combined with some great work Douglas Duteil, there is a gist with the code for adding syntax colouring to Regular Expressions.

To install this tool:

  • Download the zip file
  • Extract it to a location you want to keep it
  • Run Install.ps1 (right click and select Run with PowerShell).

This will add a junction (symbolic link) into the HTML plug ins folder of both Admin and User Installs of Alteryx after which the new Omnibus Regex tool will be available within Parse.

If you want to uninstall the plugin, then run Uninstall.ps1 it will remove the link(s).

The source code of it all is here.

2 thoughts on “Omnibus RegEx–HTML UI Experiment in Alteryx

  1. Pingback: Beyond Alteryx Macros – The Alteryx SDK and API Landscape | James Dunkerley's Blog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.