Fetch the formatted word from the clipboard

datatypes

#1

Hello everyone,

I have the PDF doc with multiple lines. I have to take the pre defined data from that PDF. The data will be there multiple times at anywhere in the PDF. How to take that ? Any help or any regex pattern to get that ?

Data format which I want,= 13 digit alphanumeric . 2 digit numeric

Ex: 123456789012a.66
234567891g456.88


#2

Check if you can accomplish the below way? Or you can get it in the string and perform Regex

9:25

Try this

^[a-zA-Z0-9-_]{0,13}.[0-9]{2}$


#3

Hey thank u so much for help…i will check and let u know…


#4

Hi VVaidya,

The given regex pattern was not working. I have attached one word doc and it has some data.

I have highlighted the some data in yellow in color and that is my actual output.

Please advise, what pattern should i use to get that highlighted data alone as a output.

Sample Doc: Sample Doc for 13 digit.pdf (112.2 KB)

thanks.


#5

Works for me, if it’s exact 13 plus 2 decimal below regex works

^[a-zA-Z0-9]{13}.[0-9]{2}$


#6

Hi vvaidya

Your test screen have only one data .that’s why it’s matched. Also ^ symbol used to get the starting line i believe.

Could u please paste the entire data which i sent and run the regex.

We should get 9 matches as per my data…

Kindly assist…


#7

Please see the screenshot which i tried as per ur instruction. All the four line have the format as i required. But we could found only one matches…

Because, the pattern only picks the line which contain only that formatted value…Uploading…

Uploading…


#8

[a-zA-Z0-9]{13}.[0-9]{2}

regex.Matches(strPdf,"[a-zA-Z0-9]{13}.[0-9]{2}")


#9

Thanks vvaidya,

But the given code is taken all the word which contain 15 digits…its not consider the Dot.

the regex will took the following format as 1234567890123 23 (its not contain the Dot)

I need the code which only taken 13.2 digits


#10

It should work, I can’t say without seeing the code.

below is your text with regex, you can always validate here and modify if needed:

https://regex101.com/r/7ZMYXa/1


#11

Hi vvaidya - please find the attached screenshot which has the matches for the given regex pattern…

I expected only for 13digit dot 2digit

But the pattern not only took dot. Its also take space, special characters, and etc…
Incorrectly taken as : 13 space 2 , 13 # 2, etc

Uploading…


#12

This should work.

[a-zA-Z0-9]{13}+(\.[0-9]{1,2})


#13

Yeah great…it’s working fine now…thanks…