Re: Regex for date

2018-08-25 Thread Chris Charley
"Asad" wrote in message news:cag3lskh4dphjg18c-jxmo8bcqfd+vix5tep1ytsp4_6pd6z...@mail.gmail.com... Hi All , I need a regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format :'%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan +91 9582111698 Hello Asad, You co

Re: Regex for date

2018-08-25 Thread Jim Gibson
Many Perl modules have been written to parse and manipulate dates and times. Some come with Perl; others are available at www.cpan.org. Check out the Date::Manip, Date::Parse, or DateTime modules. > On Aug 25, 2018, at 4:06 AM, Asad wrote: > > Hi All , > > I need a regex to match the

Re: Regex for date

2018-08-25 Thread Asad
Thanks, I'll check them out. On Sat, Aug 25, 2018 at 4:53 PM Home Linux Info wrote: > > Hello, > > Maybe not the most beautiful regex out there, hey I'm a noob, but it does > the job right: > ([A-Z][a-z]{2}\s)|([0-9]{2}\s[0-2][0-9](:[0-5][0-9]){2}\s[0-9]{4}) > You can start from here and find a

Re: Regex for date

2018-08-25 Thread Home Linux Info
Hello, Maybe not the most beautiful regex out there, hey I'm a noob, but it does the job right: ([A-Z][a-z]{2}\s)|([0-9]{2}\s[0-2][0-9](:[0-5][0-9]){2}\s[0-9]{4}) You can start from here and find a nicer form of this regex. On 8/25/18 2:06 PM, Asad wrote: Hi All ,           I need  a regex

Re: Regex for date

2018-08-25 Thread Mike Flannigan
Really, no attempt to do it yourself? Mike On 8/25/2018 6:06 AM, beginners-digest-h...@perl.org wrote: Hi All ,           I need  a regex to match the date : Sat Aug 25 08:41:03 2018 and covert into a format :  '%m/%d/%Y %H:%M:%S' Thanks, -- Asad Hasan

Re: Regex for date format

2018-06-29 Thread Mike Martin
Worked perfectly thanks, uri, and same technique works perfectly in postgresql regexp_replace for info On 29 June 2018 at 16:18, Mike Martin wrote: > Thanks > > > On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > >> On 06/29/2018 10:41 AM, Mike Martin wrote: >> >> sorry >> -mm-dd hh:mm:ss.dd

Re: Regex for date format

2018-06-29 Thread Mike Martin
Thanks On Fri, 29 Jun 2018, 15:48 Uri Guttman, wrote: > On 06/29/2018 10:41 AM, Mike Martin wrote: > > sorry > -mm-dd hh:mm:ss.dd > eg: > 2018-01-01 12-45-10-456789 to > 2018-01-01 12:45:10.456789 > > > > please reply to the list and not to me! > > then why did you want lookbehind? this

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 10:41 AM, Mike Martin wrote: sorry -mm-dd hh:mm:ss.dd eg: 2018-01-01 12-45-10-456789 to 2018-01-01 12:45:10.456789 please reply to the list and not to me! then why did you want lookbehind? this is very easy if you just grab the time parts and reassemble them as you wan

Re: Regex for date format

2018-06-29 Thread Uri Guttman
On 06/29/2018 09:32 AM, Mike Martin wrote: Hi I am trying to convert a string of the format 2018-01-01 16-45-21-654278 to a proper timestamp string so basically I want to replace all -  after the date part i am not sure what you are trying to do. show the after text that you want. a proper t

Re: regex for date "dd-mmm-yy"

2006-06-06 Thread Dr.Ruud
Mark Martin schreef: > would anybody have to hand a regex for date "dd-mmm-yy". I want to be > able to validate dates that should be along the lines of : > > 06-jan-06 See Regexp::Common::time (yes, lowercase 't') http://search.cpan.org/search?module=Regexp::Common::time -- Affijn, Ruud "Gewoo

Re: regex for date "dd-mmm-yy"

2006-06-06 Thread Bjørge Solli
On Tuesday 06 June 2006 12:52, Mark Martin wrote: > Hi, > would anybody have to hand a regex for date "dd-mmm-yy". I want to be able > to validate dates that should be along the lines of : > > 06-jan-06 m/(0?[1-9]|[12]\d|3[01])-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov| dec)-(\d\d)/i Untested.