Friday, June 03, 2005

Regular Expression Library Builder

Regular Expression Library Builder

"Regular Expressions are an immensely powerful tool in a developer's arsenal and the flavour of regexs and the classes surrounding them that are available in the .NET Framework is, in my humble opinion, excellent. One of the most useful methods of all the methods available on all the types in the System.Text.RegularExpressions namespace is the static CompileToAssembly method of the Regex class.

The CompileToAssembly method allows you to compile a regex to a standalone assembly ...
...

The solution: a "Regular Expression Library". CompileToAssembly came to my rescue. I wrote a tool to quickly allow me to easily add multiple regular expressions to a "Regular Expression Library". I can create new libraries, load and modify existing ones, quickly add, remove, modify regular expressions and then redistribute the "Regular Expression Library" assembly via an auto-update to the application. The "parent" application can get new über-efficient regular expressions and continue working without any user intervention.
...

The RegexLibrary builder allows you to:

  • Create CLS compliant Regular Expression Libraries - A .NET assembly that contains only regular expressions

  • Add multiple regular expressions to a single assembly

  • Define individual names, namespaces, regex modifiers, and accessibility levels on a per regex basis

  • Reload existing Regular Expression Libraries and add, remove, or modify regular expressions contained within

  • Manually set the version number of the assembly to help ensure compatibility with existing versions

  • Much, much, more... ;-)

    • ..."


      Now that sounds pretty darn cool. I like the whole comple to assembly idea. I can see using it in just the way described above...

      Downloaded.

6 comments:

Anonymous said...

Hey Greg,

Thanks for posting about the tool. Let me know if you like it or if you need any improvements/bug fixes etc.

Brian

Greg said...

THANK YOU for releasing it! :)

Anonymous said...

No Problem. I hope you find it useful. Let me know if you need any extra features or if you find any bugs in it.

B

Greg said...

Can do...

Anonymous said...

Thought you might be interested to know that I put up an article on CP about it after a few people contacted me and asked for it. Here's the link: http://www.codeproject.com/useritems/regexlibbuilder.asp

Greg said...

Thanks for the update...

Actually I'm ahead of you. :)
I say it on your blog and already posted about it yesterday, http://coolthingoftheday.blogspot.com/2005/06/regular-expression-library-builder-now.html

The power of RSS feeds at work. :)