Extracting a string with spaces using Regex Activities

Hi All,

I have to extact pdf data and im using Regex activities. iam able to extract all other fields but one of them is having spaces in the string and only getting half of it while extracting. can you help me how to extract the data using regex activities please??

Iam using like “ (?<=Vendor\sName:\s)(.?.(?<=\s))” using this im getting only half of the data like in “Amazon Services” im getting only amazon.

Can you anyone help me on this ??

Hi @Aswini
Try this regex “(?<=Vendor\sName:\s*)[A-Za-z\s]+” and trim the end spaces
Hope this helps

@Sanjay_Bhat

Tried using the above mentioned regex but getting error

try this
(?<=Vendor Name: )[\s\S]+(?=Vendor tax ID)

If you are using regex 101 please select .Net C#


UiPath is based on that language

Hi @Aswini

System.Text.RegularExpressions.Regex.Match(strValue,“(?<=Vendor Name:)(.*)”).ToString.Trim

you can use this expression to get the full name and trimming the data from start and last if any.

hope this will works