bala0402
(Balachandran)
May 5, 2017, 8:48pm
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
vvaidya
(Vinay Vaidya)
May 5, 2017, 9:20pm
2
Check if you can accomplish the below way? Or you can get it in the string and perform Regex
9:25
Try this
{0,13}.[0-9]{2}$
bala0402
(Balachandran)
May 6, 2017, 2:03pm
3
Hey thank u so much for help…i will check and let u know…
bala0402
(Balachandran)
May 6, 2017, 5:52pm
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.
vvaidya
(Vinay Vaidya)
May 6, 2017, 9:19pm
5
Works for me, if it’s exact 13 plus 2 decimal below regex works
{13}.[0-9]{2}$
1 Like
bala0402
(Balachandran)
May 7, 2017, 4:35pm
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…
bala0402
(Balachandran)
May 7, 2017, 4:48pm
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…
vvaidya
(Vinay Vaidya)
May 7, 2017, 5:06pm
8
[a-zA-Z0-9]{13}.[0-9]{2}
regex.Matches(strPdf,"[a-zA-Z0-9]{13}.[0-9]{2}")
1 Like
bala0402
(Balachandran)
May 19, 2017, 8:47am
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
vvaidya
(Vinay Vaidya)
May 19, 2017, 12:59pm
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:
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
bala0402
(Balachandran)
May 22, 2017, 6:34am
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…
vvaidya
(Vinay Vaidya)
May 22, 2017, 4:10pm
12
This should work.
[a-zA-Z0-9]{13}+(\.[0-9]{1,2})
bala0402
(Balachandran)
May 23, 2017, 7:03pm
13
Yeah great…it’s working fine now…thanks…