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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:29:06+00:00 2026-06-07T13:29:06+00:00

I am trying to write a regular expression that facilitates an address, example 21-big

  • 0

I am trying to write a regular expression that facilitates an address, example 21-big walk way or 21 St.Elizabeth’s drive I came up with the following regular expression but I am not too keen to how to incorporate all the characters (alphanumeric, space dash, full stop, apostrophe)

"regexp=^[A-Za-z-0-99999999'
  • 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-07T13:29:07+00:00Added an answer on June 7, 2026 at 1:29 pm

    See the answer to this question on address validating with regex:
    regex street address match

    The problem is, street addresses vary so much in formatting that it’s hard to code against them. If you are trying to validate addresses, finding if one isn’t valid based on its format is mighty hard to do.
    This would return the following address (253 N. Cherry St. ), anything with its same format:

    \d{1,5}\s\w.\s(\b\w*\b\s){1,2}\w*\.
    

    This allows 1-5 digits for the house number, a space, a character followed by a period (for N. or S.), 1-2 words for the street name, finished with an abbreviation (like st. or rd.).

    Because regex is used to see if things meet a standard or protocol (which you define), you probably wouldn’t want to allow for the addresses provided above, especially the first one with the dash, since they aren’t very standard. you can modify my above code to allow for them if you wish–you could add

    (-?)
    

    to allow for a dash but not require one.

    In addition, http://rubular.com/ is a quick and interactive way to learn regex. Try it out with the addresses above.

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

Sidebar

Related Questions

I'm trying to write a regular expression that will accept the following: s#.# f#.#
I am trying to write a regular expression that will detect a word that
I'm trying to write a regular expression that checks if an email form field
I'm trying to write a python regular expression that will match both these URLs:
I'm trying to write a regular expression for html code that looks like this:
I'm trying to write a regular expression (via Autohotkey's RegExReplace function) that will enforce
I'm trying to write a regular expression for an Ant task that excludes files
I am trying to write a regular expression, in java, that matches words and
I'm trying to write a regular expression that will validate that user input is
I'm trying to write a regular expression that will essentially return true if string

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.