Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

precompiled regular expressions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 07 May 2004 20:27 GMT
I saw this in an article in Microsoft's site, "An alternative is to use precompiled regular expressions. You can compile all of your expressions into a reusable DLL. This avoids the need to compile at runtime while still benefiting from the speed of compiled regular expressions."

I can't find where it tells you how to do this.  Can anyone help.

Article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
concompilationreuse.asp


Signature

Bill

Poolbeer - 08 May 2004 00:17 GMT
Bill,

You should take a look at the RegEx.CompileToAssembly shared method.

This article mentions it once but worth reading.
http://www.ftponline.com/vsm/2003_01/magazine/features/balena/default_pf.aspx

<QUOTE>
...
In this case, the regular expression is converted to Microsoft Intermediate Language (MSIL), which is compiled eventually to super-fast native code the first time you call the IsMatch, Match, Matches, or Replace methods. The only downsides to this technique are that the first call to the method takes slightly longer and that the native code hangs around in memory until the application shuts down. For these reasons, you should use the Compiled option only if you expect to reuse the same Regex object often during the application's lifetime. The Regex class even exposes the CompileToAssembly shared method, which lets you compile one or more regular expressions into a DLL, so that you can reuse those precompiled regular expressions later without any overhead at run time.
...
</QUOTE>

Hope this help you on your way.

Greets,

Poolbeer (MCP)

---

I saw this in an article in Microsoft's site, "An alternative is to use precompiled regular expressions. You can compile all of your expressions into a reusable DLL. This avoids the need to compile at runtime while still benefiting from the speed of compiled regular expressions."

I can't find where it tells you how to do this.  Can anyone help.

Article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
concompilationreuse.asp


Signature

Bill


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.