SunQuest
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old August 5th, 2003, 07:48 AM
Anibal Hernande Anibal Hernande is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 33 Anibal Hernande User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
How to make the RegEx below ignore only the first instance it finds for this characte

Code:
How to make the RegEx below ignore only the first instance it finds for this character " = " and continue with the rest of the file.


            Dim MyRegEx As New Regex("=\s+(?<MyPat>[0-9]*[\+.]*[0-9]*)")
            Dim s As String = txtDataView.Text
            Dim Mc As MatchCollection = MyRegEx.Matches(s)
            Dim M As Match
            Dim i As Integer
            If Mc.Count > 0 Then
                i = 0
                For Each M In Mc
                    i += 1
                    PutInTextBox(Me, "TextBox" & CStr(i), M.Groups("MyPat").Value)
                Next

Private Sub PutInTextBox(ByVal ContainerCtrl As Control, ByVal TBName As String, ByVal msg As String)
        Dim ctl As Control
        For Each ctl In ContainerCtrl.Controls
            If TypeOf ctl Is TextBox And ctl.Name = TBName Then
                ctl.Text = msg
                Exit For
            Else
                PutInTextBox(ctl, TBName, msg)
            End If
        Next
    End Sub

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > How to make the RegEx below ignore only the first instance it finds for this characte


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway