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

  • SEARCH
  • Home
  • 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 8610755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:12:12+00:00 2026-06-12T04:12:12+00:00

I have a problem processing a regex in VB. My Text is: is sadly

  • 0

I have a problem processing a regex in VB. My Text is:

is sadly currently in Toronto main station undetermined late

I tested my regex in Expresso and found this regex for my purpose. The thing is: Toronto main station can also be only “Toronto”. So this is my pattern:

is sadly currently in (([A-Za-z]*)(\s|-)){1,3}(.|\s)*?undetermined

The problem is processing the regex in VB, because my Pattern gives me a result like this:

  • is sadly currently in Toronto main station undetermined
    • undetermined
      • Toronto
      • Main
      • undetermined
    • undetermined
      • Toronto
      • Main
      • undetermined
        ….

But I cannot access the words toronto and main via VB – also I dont want ‘undetermined’ be part of the result. I tried match.item(0).submatches.item(0).submatches.item(0) but VBA already throws an error if I try match.item(0).submatches.item(0).submatches and states that there is no such object – obviously it cannot process some those “multilevel” regexes. Is there a way to improve my pattern so that I only have to use one submatches or is it possible to use multiple submatches via VBA?!

Edit:

GetDelay.Pattern = is sadly currently in (([A-Za-z]*)(\s|-)){1,3}(.|\s)*?undetermined"
GetDelay.IgnoreCase = True
GetDelay.Multiline = True
...
If GetDelay.TEst(MailBody) Then
        Set m = GetDelay.Execute(MailBody)
        If m.Item(0).SubMatches.Count > 0 Then
            OrtBody = m.Item(0).SubMatches.Item(0).SubMatches.Item(0) + " " + m.Item(0).SubMatches.Item(0).SubMatches.Item(1)  'Error 424 comes here - Object required
            If GetReason.TEst(AbweichungsmailBody) Then
                Set m = GetReason.Execute(AbweichungsmailBody)
                If m.Item(0).SubMatches.Count > 0 Then
                    Reason= m.Item(0).SubMatches.Item(0)
                Else
                    Reason= "Error!"
                End If
            Else
                Reason = "Keine Angabe gefunden!"
            End If
        Else
            thisfunction= False
        End If
    Else
        thisfunction= False
    End If
  • 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-06-12T04:12:13+00:00Added an answer on June 12, 2026 at 4:12 am

    Capturing results from a repeated sub-expression (in your case (([A-Za-z]*)(\s|-)){1,3}) gets tricky in any language. I suggest the following as a simpler approach:

    1) Match the whole portion you are interested in with a simple Regex:

    GetDelay.Pattern = "is sadly currently in (.*?) undetermined"
    

    2) Once you have matched the portion of interest, perform further analysis to get what you want. You could use another RegEx for this step, though I think you could just Split() with a space as the delimiter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem on my blog: http://osify.com while processing add new post with above
I have recently created a HTML5 canvas animation (also using Processing.js). The problem is
I have problem on processing input request parameter (of course it's type String) to
I have a problem with that code setContentView(R.layout.game); TextView text = (TextView) findViewById(R.id.qwe_string); text.setText(Hello
I have a problem with processing a SQL Server database dump in PHP. I
I'm have a problem with memory using processing and controlP5, if I use this
I have a problem with my JBOSS while reading and processing a large XML
I have a problem understanding some code fragment from Matlab Signal processing Toolbox fir2()
I have a big text file and I am processing it line by line
I have a problem with regex, using preg_match_all(), to match something of a variable

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.