Posts

Showing posts from May, 2011

Precompiled Or Inline Regular Expressions

Precompiled Or Inline Regular Expressions What to Do Consider using Precompiled Or Inline Regular Expressions in the scenarios where the same set of regular expressions are used quite often in the applications. Precompiled Regular Expressions can be created using RegexOptions.Compiled switch while defining the regular expression. Inline Regular Expressions can be created using Regex.CompileToAssembly method. Why Interpreted Regular Expressions have the least start-up time, but has performance issues at runtime. If the regular expression is used rarely in the application, use Interpreted Regular Expressions. Precompiled Regular Expressions take little more time at start-up, but gives better performance at runtime. Use Precompiled Regular Expressions for the regular expressions which are used most often in the application for better runtime performance. The precompiled regular expressions give 30 % better runtime performance then interpreted regular expressions. Inline Regular E