Introduction

What is TreeRegex?

TreeRegex is an extension of regular expressions to handle tree-like structures in text. Basically, it lets you use regular expression-like matching and replace on source code without worrying about parentheses matching problems.

TreeRegexLib is our reference implementation, available here, and we provide several tools to get started using TreeRegex.

How does it work?

Using TreeRegex requires four steps:

  1. Run a frontend to add markers - we provide a variety already, including for C/C++ and Python source code.
  2. Write and run a TreeRegex on the annotated text. The TreeRegex can perform find (and replace) tasks.
  3. De-structure it back into text.
  4. Profit!

Benefits

If you want to learn more, continue to the Tutorial