HELP NEEDED ... Regd. Regular expressions PyQt

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vishal@veriwave.com

    #1

    HELP NEEDED ... Regd. Regular expressions PyQt

    Hello All:
    I am trying to work out a regular expression in a PyQt environment for
    time in hh:mm:ss format. Any suggestions?
    Thanks,
    Vishal


  • Diez B. Roggisch

    #2
    Re: HELP NEEDED ... Regd. Regular expressions PyQt

    vishal@veriwave .com schrieb:
    Hello All:
    I am trying to work out a regular expression in a PyQt environment for
    time in hh:mm:ss format. Any suggestions?
    Yes. Read the manual to the re-module. There is _nothing_ special about
    PyQt and regexes. And provide code. But the most important thing - read
    this:




    Diez

    Comment

    • Marc 'BlackJack' Rintsch

      #3
      Re: HELP NEEDED ... Regd. Regular expressions PyQt

      In <mailman.3499.1 170501188.32031 .python-list@python.org >, vishal wrote:
      I am trying to work out a regular expression in a PyQt environment for
      time in hh:mm:ss format. Any suggestions?
      Maybe don't use a re for something that simple. Splitting at ``:``
      characters, converting to `int` and checking the value ranges isn't that
      hard without a regular expression.

      Ciao,
      Marc 'BlackJack' Rintsch

      Comment

      • timothy.kellogg@gmail.com

        #4
        Re: HELP NEEDED ... Regd. Regular expressions PyQt

        On Feb 3, 11:40 am, Marc 'BlackJack' Rintsch <bj_...@gmx.net wrote:
        In <mailman.3499.1 170501188.32031 .python-l...@python.org >, vishal wrote:
        I am trying to work out a regular expression in a PyQt environment for
        time in hh:mm:ss format. Any suggestions?
        >
        Maybe don't use a re for something that simple. Splitting at ``:``
        characters, converting to `int` and checking the value ranges isn't that
        hard without a regular expression.
        >
        Ciao,
        Marc 'BlackJack' Rintsch
        Except that if a full regex is used, the pattern can be matched or
        denied and pull out the important information simultaneously. Here's a
        simple regex that would work:

        (\d{1,2}):(\d{1 ,2}):(\d{1,2})

        but here's one that works only for the 12 hour clock:

        ((1[012])|(0?\d)):([0-5]?\d):([0-5]?\d)

        and one for the 24 hour clock:

        ((2[0-4])|([01]?\d)):([0-5]?\d):([0-5]?\d)

        I hope this helps

        --Tim

        Comment

        • Neil Cerutti

          #5
          Re: HELP NEEDED ... Regd. Regular expressions PyQt

          On 2007-02-03, vishal@veriwave .com <vishal@veriwav e.comwrote:
          I am trying to work out a regular expression in a PyQt
          environment for time in hh:mm:ss format. Any suggestions?
          After you find your time in hh:mm:ss format, be sure to check out
          time.strptime for a quick conversion.

          --
          Neil Cerutti

          Comment

          Working...