Re: DateTime multiple language validation support (C#)

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: bredal Jensen (bred.jen_at_jensen.dk)
Date: 03/02/04


Date: Tue, 2 Mar 2004 14:27:47 +0100

The regular expression shown on the site are amazingly powerfull. I'm not
used to perl and awk and stuff and i think bringing this concept to the
windows world is a very
good move.

Is there a good way of patching the following sequence of caracters in a
string without too much trouble?

^(?=\d)(?:(?:(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])
(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})|(?:0?2(\/|-|\.)29\3(?:(?:
(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3
579][26])00))))|(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(
?:(?:1[6-9]|[2-9]\d)?\d{2}))($|
(?=\d)))?(((0?[1-9]|1[012])(:[0-5]\d){0,2}(
[AP]M))|([01]\d|2[0-3])(:[0-5]\d){1,2})?$

"bredal Jensen" <bred.jen@jensen.dk> wrote in message
news:esUq0NEAEHA.2512@TK2MSFTNGP11.phx.gbl...
> Great help , thank you so much...
> "Simon Gorski >" <<s_gorski@sms.at> wrote in message
> news:u8o6jFEAEHA.808@TK2MSFTNGP12.phx.gbl...
> > Hello Bredal,
> > "bredal Jensen" <bred.jen@jensen.dk> schrieb im Newsbeitrag
> > news:OS4d%23CEAEHA.2348@TK2MSFTNGP09.phx.gbl...
> > > I need to validate a DateTime field regardless of the
> > > language my application is runnining in.
> > > I have a textbox field where users can enter the
> > > date like this:
> > >
> > > 02-03-2004 10:58:40 ----> meaning
> > > (March the 3rd 2004 10:58:40 AM).
> > >
> > >
> > > Any help will be great.
> > >
> > Work with regular expressions...look at this site..you will find the
right
> > syntax..
> >
> > http://www.regexlib.com/Search.aspx
> >
> > mfg simon g.
> >
> >
>
>



Relevant Pages

  • Re: regular expression for perl, tcl, sed, grep, awk
    ... > I wonder is the regular expression the same for perl, tcl, sed, grep ... > and awk except for the syntax? ... which sorts of RE are supported by your sed, grep and awk. ...
    (comp.lang.perl.misc)
  • Re: sed help
    ... > Kevin Rodgers ... > Nor with awk; see ... There's a seperate library for perl RE's. ... Philip Hazel's Perl Compatible Regular Expression library ...
    (comp.unix.shell)
  • AWK vs SED
    ... Can anyone tell me the difference between AWK and SED? ... SED is mainly a regular expression similar to perl's by ... Is AWK another langruage similar to Perl? ... command line similar to SED? ...
    (comp.unix.shell)
  • Re: AWK vs SED
    ... > Can anyone tell me the difference between AWK and SED? ... SED is mainly a regular expression similar to perl's by ... Is AWK another langruage similar to Perl? ... > command line similar to SED? ...
    (comp.unix.shell)
  • Re: Generic programming in C
    ... But I've generally seen a short script in a language like ... you've done in C represents one line of Perl, ... I never got the hang of sed and I find awk very limited (lack of ... bloat of the template for the flexible array container is just 2.3K ...
    (comp.lang.c)