Reges is not getting the information

Hello All,

I want to search this regex in my pdf : and i have two ways;I used extracot by regex
Hello I have this
Actual Date: 27-DEC-21 07:00
Before Date: 27-DEC-21 07:00

I want to get date if it started wwith actual or Before (in some pdf) but if there is the both (in one pdf) it will be able to get JUST THE FIRST OCCURENCE
I used
.(?:\r?(^(Actual|Before)\w(\s)Date(:)(\s+)(\d+)(-)(\w+)(-)(\d+)(\s+)(\d+)(:)(\d+)))

Best regards

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=(Actual|Before)\s*Date:\s*)\d+-(JAN|FEB|MAR|APR|MAR|JUN|JUL|AUG|SEP|OCT|NOV|DEC)-\d+\s+\d+:\d+").Value

Regards,

1 Like

grafik
grafik

 strPattern
 "(Actual |Before )Date: \d+\-[A-Z]{3}-[\d\ \:]{8}"
 myMatches = regex.Matches(strText, strPattern)
 MatchCollection(2) { [Actual Date: 27-DEC-21 07:00], [Before Date: 27-DEC-21 07:00] }
 myMatches(0).Value
 "Actual Date: 27-DEC-21 07:00"
 myMatches(1).Value
 "Before Date: 27-DEC-21 07:00"
 myMatches.Cast(Of Match).Select(Function (m) m.Value).toArray
 string[2] { "Actual Date: 27-DEC-21 07:00", "Before Date: 27-DEC-21 07:00" }

maybe you can share with us your current implementation e.g. as a screenshot

2 Likes

Thank you lot , how can I put this in Regex Based Extractor (for Document undestanding )please

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