i am using OCR to read through driver’s licenses and i need to pull the number off of them. problem is that the scan quality is not universal so finding the index of the preceding characters is not working all the time. but the number itself seems to pretty accurate.
what is the best way to scan through the text and find the 9 digit number in the text block then pull that substring out?
If you have text then use regex. If the data you require is of 9 digits then you can use this regex - \d{9}. This would help you in retrieving the numbers from any given text easily.