Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6922919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:28:07+00:00 2026-05-27T10:28:07+00:00

I have a RegEx I am using in vb.net and i can get all

  • 0

I have a RegEx I am using in vb.net and i can get all the matches of the text but i want to get the first match of the text, this is what i am using.

Text: :1283 xxxxxxxxxx :1288 :9879

RegEx: :[0-9]+

How do i just get the first match (:1283)?

The code i am using is:

Dim MRIDRegex As New Regex(":[0-9]+")
    Dim count As Integer = 0
    Dim mrid As String = String.Empty
    For Each item As Match In MRIDRegex.Matches(message)

        count += 1
        If count = 1 Then
            mrid = item.Value
        End If

    Next
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:28:08+00:00Added an answer on May 27, 2026 at 10:28 am

    I searched on Google for vb.net regex match, and this was the first result. This is the code sample they used.

    Imports System.Text.RegularExpressions
    
    Module Module1
    
        Sub Main()
        ' The input string.
        Dim value As String = "/content/alternate-1.aspx"
    
        ' Invoke the Match method.
        Dim m As Match = Regex.Match(value, _
                         "content/([A-Za-z0-9\-]+)\.aspx$", _
                         RegexOptions.IgnoreCase)
    
        ' If successful, write the group.
        If (m.Success) Then
            Dim key As String = m.Groups(1).Value
            Console.WriteLine(key)
        End If
        End Sub
    
    End Module
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm using regex to get some information from a website, i have this code:
I'm using C# and .NET and I have a Regex that looks like this
I am using Perl to do text processing with regex. I have no control
I am currently using this regex to get the page number from the url:
to all. i developing a webpage using asp.net with c# language, in this webpage
This seems like it should have a simple solution but I can't seem to
I'm using WinForms NET 2.0 in C#. I have text files, of about 1000-1500
I have to validate using regex decimal number between 00.00 to 35.35 with following
Good afternoon, I'm learning about using RegEx's in Ruby, and have hit a point
I have written a class using std::tr1::regex, and I don't know how to link

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.