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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:58:17+00:00 2026-06-17T09:58:17+00:00

How do you express a regular expression where the string matches the following. text,

  • 0

How do you express a regular expression where the string matches the following.

text, text, number

NOTE:

text = can be any amount of words or spaces.

number = most be 4 digit number.

the commas (,) must be matched too.

As an example, the following string is valid:

'Arnold Zend, Red House, 2551'
  • 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-17T09:58:18+00:00Added an answer on June 17, 2026 at 9:58 am

    The regex pattern for that would be (the parenthesis are capture groups in-case you want to access the individual items:

    ([a-zA-Z\s]{3,}), ([a-zA-Z\s]*{3,}), ([0-9]{4})
    

    It matches 2 names and a 4 digit number separated by a comma with the names being at-least 3 characters long. You can change the name character minimum if you’d like. And this is how to check if a string matches this pattern:

    // 'Regex' is in the System.Text.RegularExpressions namespace.
    
    Regex MyPattern = new Regex(@"([a-zA-Z\s]*), ([a-zA-Z\s]*), ([0-9]{4})");
    
    if (MyPattern.IsMatch("Arnold Zend, Red House, 2551")) {
        Console.WriteLine("String matched.");
    }
    

    I have tested the expression with RegexTester and it works fine.

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

Sidebar

Related Questions

How can I express not preceded by in a Java regular expression? For example
I have the following: Text: field id=25 ordinal=15 value=& $01234567890-$2000- Regular Expression: (?<=value=).*(?=) Replacement
I don't understand, why does the following regular expression: ^*$ Match the string 127.0.0.1?
Im trying to create a method that checks a string against a regular express
I have tried to find a way to enter regular expression into an express
So, I want to built a regular expression that I can pass in a
I've done a regular expression to match urls following the next pattern: part1-part2-part3.html where
I know most regular expression engines, including the one in JavaScript have \b to
I'm trying to understand how can I use regular expressions in express js, I
I have the following regular expression: [0-9]{8}.*\n.*\n.*\n.*\n.* Which I have tested in Expresso against

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.