Regex.CompileToAssembly : Regular Expressions « Regular Expressions « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net Tutorial » Regular Expressions » Regular Expressions 
20.1.7.Regex.CompileToAssembly
Imports System.Text.RegularExpressions

Public Class Tester
    Public Shared Sub Main
        Dim numPattern As String = _
           "[-+]?([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?"
        Dim wordPattern As String = "\w+"
        Dim whichNamespace As String = "NumbersRegex"
        Dim isPublic As Boolean = True

        Dim compNumbers As New RegexCompilationInfo(numPattern, _
           RegexOptions.Compiled, "RgxNumbers", _
           whichNamespace, isPublic)
        Dim compWords As New RegexCompilationInfo(wordPattern, _
           RegexOptions.Compiled, "RgxWords", whichNamespace, _
           isPublic)
        Dim compAll() As RegexCompilationInfo = _
           {compNumbers, compWords}

        Dim whichAssembly As New _
           System.Reflection.AssemblyName("RgxNumbersWords")
        Regex.CompileToAssembly(compAll, whichAssembly)

    End Sub


End Class
20.1.Regular Expressions
20.1.1.Regex Matches
20.1.2.Word count
20.1.3.Regex('\w+')
20.1.4.Count chars: Regex.Matches(quote, .)
20.1.5.Word count: Regex.Matches(quote, '\w+')
20.1.6.Count line: Regex.Matches(quote, '.+\n*')
20.1.7.Regex.CompileToAssembly
20.1.8.Match regular expression to string and print out all matches
20.1.9.Using Regex method Replace: substituted for *
20.1.10.Using Regex method Replace: Replace one string with another
20.1.11.Every word replaced by another word
20.1.12.Replace first 3 digits
20.1.13.String split at commas
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.