Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Regular Expressions
  4. Adresse erfassen mittels RegEx

Adresse erfassen mittels RegEx

Scheduled Pinned Locked Moved Regular Expressions
questionregex
6 Posts 3 Posters 23 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_15656899
    wrote on last edited by
    #1

    Hello all, I have a question regarding regex address capture. I have the following address: Harald Sturm Schönstrasse 18a 60311 Frankfurt am Main I want to split this string into 4 components with 4 different regex to do that. Name: Harald Sturm. (The whole first line) Street: Schönstrasse 18a (The whole second line) ZIP CODE: 60311 (First digital part of the sentence ) Location: Frankfurt am Main (Last part of the sentence) Question for the regex experts: What would each regex expression for this look like ? Many thanks in advance.

    OriginalGriffO L 2 Replies Last reply
    0
    • M Member_15656899

      Hello all, I have a question regarding regex address capture. I have the following address: Harald Sturm Schönstrasse 18a 60311 Frankfurt am Main I want to split this string into 4 components with 4 different regex to do that. Name: Harald Sturm. (The whole first line) Street: Schönstrasse 18a (The whole second line) ZIP CODE: 60311 (First digital part of the sentence ) Location: Frankfurt am Main (Last part of the sentence) Question for the regex experts: What would each regex expression for this look like ? Many thanks in advance.

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      To be honest, unless your addresses are pretty rigidly controlled, you are probably on a loser even trying: Extract addressline, state, city, zipcode into different columns from one single column called “adress” with space as delimeter using posgresql[^] But ...

      (?.+?)\r\n(?.+?)\r\n(?\d+?)\s+(?.+)

      May do it ... I needed to play with regex options Mutiline = true, SingleLine = true and change "$" to "\r\n" to get it working in Expresso.

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      M 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        To be honest, unless your addresses are pretty rigidly controlled, you are probably on a loser even trying: Extract addressline, state, city, zipcode into different columns from one single column called “adress” with space as delimeter using posgresql[^] But ...

        (?.+?)\r\n(?.+?)\r\n(?\d+?)\s+(?.+)

        May do it ... I needed to play with regex options Mutiline = true, SingleLine = true and change "$" to "\r\n" to get it working in Expresso.

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

        M Offline
        M Offline
        Member_15656899
        wrote on last edited by
        #3

        I don't have a label like name, street etc- I just always have three lines. The first line always records the full name. The second line records the street including the house number. The third line consists of a postal code and city. Thereby the postal code and the city should be extracted separately. I would need four single regex rules at last. Thanks a lot in advance

        OriginalGriffO 1 Reply Last reply
        0
        • M Member_15656899

          I don't have a label like name, street etc- I just always have three lines. The first line always records the full name. The second line records the street including the house number. The third line consists of a postal code and city. Thereby the postal code and the city should be extracted separately. I would need four single regex rules at last. Thanks a lot in advance

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #4

          Did you try the regex I supplied? At all?

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          1 Reply Last reply
          0
          • M Member_15656899

            Hello all, I have a question regarding regex address capture. I have the following address: Harald Sturm Schönstrasse 18a 60311 Frankfurt am Main I want to split this string into 4 components with 4 different regex to do that. Name: Harald Sturm. (The whole first line) Street: Schönstrasse 18a (The whole second line) ZIP CODE: 60311 (First digital part of the sentence ) Location: Frankfurt am Main (Last part of the sentence) Question for the regex experts: What would each regex expression for this look like ? Many thanks in advance.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            A few lines of code including one call to String.Split would do that much quicker than a regex.

            M 1 Reply Last reply
            0
            • L Lost User

              A few lines of code including one call to String.Split would do that much quicker than a regex.

              M Offline
              M Offline
              Member_15656899
              wrote on last edited by
              #6

              You may right, but im using it for a rpa tool, that accept only a regex confirm formula for extracting operations.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups