I first thought a quantifier (\s+\S+){4,5}$ would take care of 4 or 5 words, but I think as @Mansi_Mhatre will inform us, this address parsing for long addresses is quite tricky. Here the ending string can also just be "Mumbai IN 89L".
Address parsing is very difficult and patterns change from one country to other.
It would be great to have inside UiPath a fuzzy database extractor that helps you locate address parts based on the possible relations between them. For example if you can collect a database of street names with zip codes and province/state you may use this feature to accurately locate full address. Variable parts like street number can be extracted using regex (related to previous result position)
This is a great feature available in document processing software like Kofax Transformation
I will create a feedback post expanding this topic
I have given countries keywords with name in dictionary (key,value).
So i want to check address string from backside i e. Last word first to find accurate Country.
Basically I want to check string in reverse order if multiple country keywords found then it should return last keyword country name.
Input example 1:
“786 apartment, Shanghai building, Mumbai 400710”
It contains 2 keywords - 1 from (Shanghai)china and 1 from (Mumbai) India
Output:
India(Mumbai)
Input example 2:
" Kingston apartment, near Uk ambassy , Madrid 7896 ES"
It contains 3 keywords- 1 from Jamaica (Kingston), 1 from England (UK) and 1 from Spain(Madrid)