Using Regex For Extracting info from Pdf

Hello everyone,
I need some help me here to extract some data by regex from this line of text after transformed the pdf file to text

17 PORT Torino - Notebook sleeve - 14" - black 1 1900.00 1900.00

I need to extract the part which is equal to 1 based on the number of items related to which it’s number 17 and the other parts from the text 1900.00 both of them for putting them into a variable to use them.
Thanks in advance .

Hello @Islam_Hadid
you can use below pattern to get the desired values:

(^[0-9]{1,9}) to get “17” from sample text line
([0-9.]{0,10}$) to get “1900.00” from sample text line

let us know if this helps you

2 Likes

Hi @Islam_Hadid

Also try below regex for the same :-
image

Output :-
image

Group1 gives you initial No i.e., 17
Group2 gives you Last 2 No’s i.e., 1900.00 1900.00

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: