Re: Common regex for timedate

2018-11-19 Thread Asad
Thanks, I'll check them out. On Wed, Nov 14, 2018 at 11:17 PM Andy Bach wrote: > > Yes the purpose is to compare the timestamps ans yes these are the only > two formats . > > Then you probably want to look at modules, like Date::Manip, google has > lots of suggestions: > > https://stackoverflow.

Re: Common regex for timedate

2018-11-14 Thread Andy Bach
> Yes the purpose is to compare the timestamps ans yes these are the only two formats . Then you probably want to look at modules, like Date::Manip, google has lots of suggestions: https://stackoverflow.com/questions/4199504/what-is-the-best-way-to-compare-dates-in-perl https://www.perlmonks.org/?

Re: Common regex for timedate

2018-11-13 Thread Asad
Hi Andy , thanks for the reply . Yes the purpose is to compare the timestamps ans yes these are the only two formats . Thanks, On Wed, Nov 14, 2018 at 2:48 AM Andy Bach wrote: > Calling upgrade.sql on 05-JUL-18 10.19.42.559000 PM -12 > Calling apply.sql on 17.10.18 12:28:12,447849

Re: Common regex for timedate

2018-11-13 Thread Andy Bach
Calling upgrade.sql on 05-JUL-18 10.19.42.559000 PM -12 Calling apply.sql on 17.10.18 12:28:12,447849 +02: > I created on regex : \d\d\.\d\d\.\d\d\s[012][0-9]:[0-5][0-9]>:[0-5][0-9] > this only matches : Calling apply.sql on 17.10.18 12:28:12,447849 +02: Right as your first string has word chars

Re: Common regex for timedate

2018-11-13 Thread Дмитрий Ананьевский
On Mon, 12 Nov 2018 18:18:12 +0530 Asad wrote: > Hi all , > >I have two stings from logfile how can we have a common regex so > that its parse datetime details for further parsing ; > > Calling upgrade.sql on 05-JUL-18 10.19.42.559000 PM -12 > Calling apply.sql on 17.10.18 12:28:12,

Re: Common regex for timedate

2018-11-12 Thread David Y Wagner via beginners
You could change the first portion of RegEx to \d{2}[.\-](\d{2}|\D{3})[.\-] This could cover all the valid Month codes, but this will look for the hyphen or period and two digit month or three non digits and then the the hyphen or period following. There is much more you could do, but this cove