Can regular expression validation do this?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ed Chiu

    Can regular expression validation do this?

    Hi,

    I want to use regular expression validator to validate time in the pattern
    of 00:00 to 23:59 , what should the expression look like?

    TIA
  • Karl Seguin

    #2
    Re: Can regular expression validation do this?

    something like this ought to work:

    [0-2]\d:[0-5]\d

    Karl

    --
    MY ASP.Net tutorials
    Programming blog exploring Zig, Elixir, Go, Testing, Design and Performance



    "Ed Chiu" <EdChiu@discuss ions.microsoft. com> wrote in message
    news:FA187B80-CE6B-427E-A012-4E39751EFEF5@mi crosoft.com...[color=blue]
    > Hi,
    >
    > I want to use regular expression validator to validate time in the pattern
    > of 00:00 to 23:59 , what should the expression look like?
    >
    > TIA[/color]


    Comment

    • Chris R. Timmons

      #3
      Re: Can regular expression validation do this?

      "=?Utf-8?B?RWQgQ2hpdQ= =?=" <EdChiu@discuss ions.microsoft. com>
      wrote in news:FA187B80-CE6B-427E-A012-4E39751EFEF5@mi crosoft.com:
      [color=blue]
      > Hi,
      >
      > I want to use regular expression validator to validate time in
      > the pattern of 00:00 to 23:59 , what should the expression look
      > like?[/color]

      ([0-1][0-9]|2[0-3]):[0-5][0-9]

      --
      Hope this helps.

      Chris.
      -------------
      C.R. Timmons Consulting, Inc.

      Comment

      Working...