473,326 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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
Feb 3 '07 #1
4 1721
vi****@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:
http://www.catb.org/~esr/faqs/smart-questions.html

Diez
Feb 3 '07 #2
In <ma***************************************@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
Feb 3 '07 #3
On Feb 3, 11:40 am, Marc 'BlackJack' Rintsch <bj_...@gmx.netwrote:
In <mailman.3499.1170501188.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

Feb 4 '07 #4
On 2007-02-03, vi****@veriwave.com <vi****@veriwave.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
Feb 5 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Steve | last post by:
Hello, I am writing a script that calls a URL and reads the resulting HTML into a function that strips out everthing and returns ONLY the links, this is so that I can build a link index of various...
10
by: svenn.are | last post by:
Hi, I wanted to run a program that is written in PyQt on my mac, and went over to Riverbank to get PyQ 3.13 and SIP 4.1.1 sources. I followed the installation guide except for the compiling...
5
by: Karin Jensen | last post by:
Hi I am writing in PHP and trying to work with regular expressions on records in a multilanguage database. I understand regexp basics, but have bitten off more than I can chew here and really...
27
by: VK | last post by:
<http://www.jibbering.com/faq/#FAQ3_2> The parts where update, replacement or add-on is needed are in <update> tag. 3.2 What online resources are available? Javascript FAQ sites, please...
1
by: S. H. | last post by:
I am using a small function to return information from an Access database. Whether I use xml formatted text or otherwise, the results are returned to me in a formatted way. I'm new to C#, so I'm...
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
3
by: Zach | last post by:
I'm writing an app which is going to rely extremely heavily on the usage of regular expressions. I'm reading the docs but having trouble wrapping my head around some of this since it's all fairly...
2
by: vishal | last post by:
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
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.