Integrate RegexMagic with Searching, Editing and Coding Tools

RegexMagic is designed to be used as a companion to whatever software you use regular expressions with. Such applications include search tools, text editing and processing tools, programming and development tools, etc. Whenever you need to create a regular expression while working with those applications, RegexMagic pops up to build the regex, and disappears when you finish creating it.

Without integrating RegexMagic with your tools, this workflow takes many steps:

  1. Start RegexMagic via a desktop or start menu shortcut.
  2. Create the regular expression.
  3. Copy the regular expression from RegexMagic to the clipboard, manually selecting the correct format.
  4. Close RegexMagic.
  5. Paste the regular expression into your tool.

Basic Integration

Integrating RegexMagic with your favorite tools can significantly speed up this workflow by automating most of the steps. The simplest form of integration is by starting RegexMagic with certain command line parameters. This method is appropriate when you want to integrate RegexMagic with a 3rd party tool. If the tool has the ability to run external applications, you can easily launch RegexMagic from within the tool.

E.g. in Microsoft Visual Studio 2003, you could select Tools|External Tools from the menu, and specify the following arguments: -putonclipboard -string basic -flavor dotnet -appname "Visual Studio". Use -string c# instead of -string basic if you develop in C# rather than Visual Basic.

When adding RegexMagic to Delphi’s Tools menu, you can specify -putonclipboard -string pascal -flavor pcre -flavorreplace jgsoft -appname Delphi for the parameters. This selects the regex flavor used by TPerlRegEx.

This style of integration, which only takes a few minutes to implement, reduces the workflow to:

  1. Start RegexMagic from a menu item, button or keyboard shortcut in your tool.
  2. Create the regular expression.
  3. Click the Send To button in RegexMagic, which closes RegexMagic and automatically puts the regex on the clipboard, in the right format.
  4. Paste the regular expression into your tool.

Though you still need to copy and paste the regular expression from and into your tool, the reduced workflow is a lot more convenient. You can launch RegexMagic from within your tool, and RegexMagic automatically uses the correct regex flavor and string style for your tool.

Advanced Integration

Tighter integration is possible with tools that have a programming interface (API), and with software that you develop yourself. RegexMagic provides a COM Automation interface, which you can easily import and call from any development tool or language that supports COM. The interface enables you to launch RegexMagic, and send and receive regex actions in response to the user’s actions.

Except for actually creating the regular expression, the workflow is automated entirely:

  1. Start RegexMagic from a menu item, button or keyboard shortcut in your tool.
  2. Create the regular expression.
  3. Click the Send To button in RegexMagic, which automatically updates the regex in your tool, and closes RegexMagic.

If you are a software developer, and some of your products support regular expressions, make your customers happy and provide tight integration with RegexMagic. Take a look at PowerGREP and EditPad Pro to see how convenient they make it to create a regular expression with RegexMagic.