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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:04:05+00:00 2026-05-23T16:04:05+00:00

My regex needs to parse an address which looks like this: BLOOKKOKATU 20 A

  • 0

My regex needs to parse an address which looks like this:

BLOOKKOKATU 20 A 773 00810 HELSINKI SUOMI
-------------------- ----- -------- -----
          1            2       3      4*

Groups one, two and three will always exist in an address. Group 4 may not exist. I’ve written a regex that helps me get the first, second and third part but I would also need the fourth part. Part 4 is the country name and can either be FINLAND or SUOMI. If the fourth part didn’t exist in an address the fourth group would be empty. This is my regex so far but the third group captures the country too. Any help?

(.*?)\s(\d{5})\s(.*)$

(I’m going to be using this Oracles REGEXP function)

  • 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-23T16:04:05+00:00Added an answer on May 23, 2026 at 4:04 pm

    Change the regex to:

    (.*?)\s(\d{5})\s(.+?)\s?(FINLAND|SUOMI)?$
    

    Making group three none greedy will let you match the optional space + country choices. If group 4 doesn’t match I think it will be uninitialized rather than blank, that depends on language.

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

Sidebar

Related Questions

I need to parse string that looks like in example below: Regex TitleRegex =
I need a PHP Regex that can parse .strings files. In particular, it needs
It is possible to write a Regex which needs in some cases exponential running
I am working on an app which needs to parse URLs (mostly HTTP URLs)
I have a string like this that I need to parse into a 2D
I am using regex in C# I need to parse a string till it
I need the Perl regex to parse plain text input and convert all links
My regex needs to match two words in a sentence, but only the second
I'm working on an app that needs to accept a RegEx from the user,
I'm currently modifying my regex for this: Extracting email addresses in an html block

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.