Hi there, I would like to capture the supplier name as shown below using Regex Matches. However, I’m only able to capture “UNITED SPACY PLUS EQUIPMENT PTE” and the “LTD” is always left out as it is on a separate line. Have tried using “\n” in my Regex but it doesn’t seem to work. When I run the cursor from left to right on the PDF file, it runs from “UNITED SPACY PLUS EQUIPMENT PTE” to “LTD” then move on to “Invoice Date”.
The current Regex Matches statement I’m using is “Name:\s+([@\w.\s-&()']+)\s+Invoice”.
Please help and offer some advice if you know the solution, thanks.
Hi Pratik, I encounter a situation. You see, I realised not all the names are double-lined. When the bot runs into single-lined Names, it captures the next line - Address line into the capture as well. I think this requires a change in my Regex: "(?<=Name:)(.*\s.+)(?=Invoice Number:\s.+)(.+)(\s.+). Will you be able to help?
Thanks, what you have proposed is something I have not thought of. Will try it out.
For the time being, this method that I tried seems to work for now (but I have no reason why it works ):
“(?<=Name:)(.*\s.+)(?=Invoice Number:\s.+)(.+)(\s\D+)Address”