Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Change Street number and street name in regex's rules #25

Open
oxlupo opened this issue Dec 23, 2021 · 0 comments
Open

How to Change Street number and street name in regex's rules #25

oxlupo opened this issue Dec 23, 2021 · 0 comments

Comments

@oxlupo
Copy link

oxlupo commented Dec 23, 2021

Hi Dear vladimarius

Thank you for publishing this program I wanna use your program for euro country that has different street addresses formating
for example :
AUSTRIA
"""Mr J Brownhall
264 High Street
ALLAMBIE NSW 2100
AUSTRALIA"""

has this formating you implemented in US code in this format :
full_street = r"""
(?:
(?P<full_street>
{street_number}?,?\ ?
{street_name}?,?\ ?

        (?:[\ \,]{street_type})\,?\ ?
        {post_direction}?\,?\ ?
        {floor}?\,?\ ?
        {building}?\,?\ ?
        {occupancy}?\,?\ ?
        {po_box}?
    )
)""".format(street_name=street_name,
            street_number=street_number,
            street_type=street_type,
            post_direction=post_direction,
            floor=floor,
            building=building,
            occupancy=occupancy,
            po_box=po_box,
            )

I get in trouble when I want to change the street number and street name :
full_street = r"""
(?:
(?P<full_street>
{street_name}?,?\ ?
{street_number}
(?:[\ ,]{street_type}),?\ ?
{post_direction}?,?\ ?
{floor}?,?\ ?
{building}?,?\ ?
{occupancy}?,?\ ?
{po_box}?
)
)""".format(street_name=street_name,
street_number=street_number,
street_type=street_type,
post_direction=post_direction,
floor=floor,
building=building,
occupancy=occupancy,
po_box=po_box,
)

and error is :
raise source.error(msg, len(condname) + 1)
re.error: unknown group name 'street_number' at position 142 (line 8, column 28)

Could you possibly help me
I would be grateful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant