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 1084937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:37:31+00:00 2026-05-16T22:37:31+00:00

I am attempting to extract all data from a file with one regex expression.

  • 0

I am attempting to extract all data from a file with one regex expression. Since there are optional(?,*) and repitious(*,+) expressions, it would be difficult to enumerate through the captures, at least in a readable and understandable fashion. Therefore, I am using named groups. However the data is in an XML like structure; neseted elements can have complex elements. So I am using nested name groups. However, one I have captured a group, how do I retrieve the nested groups by name?

Dim mtch = System.Text.RegularExpressions.Regex.Match(fullText, _
                                       "\s+(?<PolyID>\d+)" & _
                                       "\s+(?<Center>" & _
                                            "(?<LAT>\-?\d\.\d+E\+\d{2})" & _
                                            "\s+(?<LON>\-?\d\.\d+E\+\d{2})" & _
                                        ")\n(?<Point>\s+" & _
                                            "(?<LAT>\-?\d\.\d+E\+\d{2})" & _
                                            "\s+(?<LON>\-?\d\.\d+E\+\d{2})" & _
                                        "\n)+END\n", _
                                        System.Text.RegularExpressions.RegexOptions.Singleline)

I am trying to get the

mtch.Group("Center").Group("LAT").Value

How can I retrieve named subgroups of the current group?

  • 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-16T22:37:32+00:00Added an answer on May 16, 2026 at 10:37 pm

    I would suggest that you rename your groups to “CenterLAT”, “CenterLON”, “PointLAT”, and “PointLON”. You might be able to get what you want from the mtch.Groups("Center").Captures collection, but you can’t index that collection by name.

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

Sidebar

Related Questions

I am attempting to extract all instances of a particular format from a string:
I'm attempting to extract data from log files and organise it systematically. I have
I am attempting to extract pitch data from an audio stream. From what I
Attempting to use the data series from this example no longer passes the JSONLint
I'm attempting to extract a given pattern within a text file, however, the results
I have a Excel .CSV file I'm attempting to read in with DictReader. All
I just found a weird behavior when attempting to extract a string from the
I am attempting to download a gunzipped file from an FTP server. It appears
I am attempting to extract a fundamental frequency from a sound source. maybe someone
I've spent the past day attempting to extract a one XML node out of

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.