Could you let us know if the PDF is a Digital or a Scanned PDF. In addition could you also tell us what was the Extraction method used ?
Maybe we could solve this from the Source data/method if possible.
An Alternate method is such that we can However use Regex, provided we know some more details for the Regex pattern to be Strict for you case of Extraction, Below pattern does match, but do test it for different cases :
extractedAddr = "B4567, Western Avenue , Banglore, Karnataka India 560068560068"
Considering after extraction you would want to keep only one pincode, meaning there is always one pincode, you could Check the following :
It is not a scanned pdf. It’s a digital copy. I am using pdf to string activity and using a combination of regex and string manipulation to fetch the data.
I found the solution
Variable = new Regex(“([0-9]{6})”).Replace(Variable,“”,1)
This is replacing only once occurrence of the pincode .