How to extract specific text like name number from large text in

I have field where we want to extract number, name, school.sometimes it may be in 7th line or some other lines.Order of lines may be different.
How to extract in that case.Can anyone please help.

For eg,
Hi,find the below information.
It involves all the info about student.
Basic and personal details and educational details are also included for additional information.

What is name? Sri
Is student btech or BE?

Mobile number of student: xxxxxxxxxx,yyyyyyyyyy

For this eg,we need to extract name, BTech or BE, number.order of the lines can be different for another student.can anyone please help

If multiple phone numbers provided means,1st phone number should be taken and processed and then take another phone number and process.
Can anyone help how we can achieve this?


Can you provide the sample data for 2 to 3 students?


If the question text is always the same, you could use regular expressions to extract the answer to a question regardless of what position it is in. Essentially you would program it to look for “What is name?” and then extract the remainder of the line. The answer from the mobiles field could then be split by commas.

If this is an email template or something which is entirely free-text could look at entity recognition models from cognitive services perhaps.

What ever i have given will be the data.for some students what is name will be at 5th line or another the same way for mobile number and btech or BE.irrespective of line how we can get name,btech or BE and mobile number?

Can u share any example


Try this:


Assign strName = System.Text.RegularExpressions.RegEx.Match(InputVariable,"(?<=name.\s).*").ToString



Assign strStudent = System.Text.RegularExpressions.RegEx.Match(InputVariable,"(?<=student.[A-Za-z]{5}.[a-zA-Z]{2}.[a-zA-Z]{2}.\s).*").ToString



Assign strPhoneNumber = System.Text.RegularExpressions.RegEx.Match(InputVariable,"\d{10}").ToString



Not able to install system.regular expressions in manage packages.package installation failure it is saying

The regular expressions are part of UiPath’s core activity packs.

Example :

Got it for name and phone number but for btech or BE not getting
For eg line is
Is this an btech or BE?
For this line how we can write regex?

Got it can we trim spaces before and after string?

How can we remove spaces before and after string using regex.getting space before btech and phone number.How can we do this?


Try like this



This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.