Hi everyone,
I’m trying to extract the street name, house number, and house number suffix from a WooCommerce shipping address field (e.g. Tweede Helmersstraat 43 II ) in a Set Variable module.
The format of the address can vary:
- Some street names are 1 to 4 words long
- House numbers may or may not have a suffix (e.g.
43
,43II
, or43-A
) - The address is stored in
6.shipping.address1
I want to:
- Get everything before the first digit as the street name
- Get the digits as the house number
- Get anything after the digits as the suffix
I tried using indexOf()
to find the first digit and then substring()
, but I’m running into function errors, or pos = 999
.
Has anyone successfully handled this type of address parsing in Make? A robust solution or function example would be greatly appreciated.
Thanks in advance!
Aymen
edit1: to retrieve the street name, I also tried this but received an empty output.