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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:55:41+00:00 2026-05-23T18:55:41+00:00

I need help extracting the value of a wildcard from a Regular Expressions match.

  • 0

I need help extracting the value of a wildcard from a Regular Expressions match. For example:

Regex: “I like *”

Input: “I like chocolate”

I would like to be able to extract the string “chocolate” from the Regex match (or whatever else is there). If possible, I also want to be able to retrieve several wildcard values from a single wildcard match. For example:

Regex: “I play the * and the *”

Input: “I play the guitar and the bass”

I want to be able to extract both “guitar” and “bass”. Is there a way to do it?

  • 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-23T18:55:42+00:00Added an answer on May 23, 2026 at 6:55 pm

    In general regex utilize the concepts of groups. Groups are indicated by parenthesis.

    So I like
    Would be I like (.) . = All character * meaning as many or none of the preceding character

    Sub Main()
        Dim s As String = "I Like hats"
        Dim rxstr As String = "I Like(.*)"
        Dim m As Match = Regex.Match(s, rxstr)
        Console.WriteLine(m.Groups(1))
    
    End Sub
    

    The above code will work for and string that has I Like and will print out all characters after including the ‘ ‘ as . matches even white space.

    Your second case is more interesting because the first rx will match the entire end of the string you need something more restrictive.

    I Like (\w+) and (\w+) : this will match I Like then a space and one or more word characters and then an and a space and one or more word characters

    Sub Main()
    
        Dim s2 As String = "I Like hats and dogs"
        Dim rxstr2 As String = "I Like (\w+) and (\w+)"
        Dim m As Match = Regex.Match(s2, rxstr2)
        Console.WriteLine("{0} : {1}", m.Groups(1), m.Groups(2))
    End Sub
    

    For a more complete treatment of regex take a look at this site which has a great tutorial.

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

Sidebar

Related Questions

I need some help extracting the following bits of information using regular expressions. Here
need a little help with extracting part of the URL via regex I have
My (Perl-based) application needs to let users input regular expressions, to match various strings
Need some help with extracting 2 pieces of information from the following string: viewed
Need help to convert code from asp control to input type to fetch file
Need help. It may be weird. First activity has listview(like lazyadapter) once i click
need help to create regular expression matching string www.*.abc.*/somestring Here * is wild card
Need help writing a script downloads data from google insight using c# this is
need help in error in database pivot. i have table tamed table_score like below:
I need help creating a self extracting zip file that does not display anything.

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.