You Are Here:

Community: Developer Discussion Boards

#1 Old Unhappy validate text box with regular expression - 2009-06-22, 13:15

Join Date: Jun 2009
Posts: 11
mt.jijo
Offline
Registered User
Hi,
Can anyone help me with how to validate text box with regular expression in pys60 with an example?

Thanks in advance
Cyan
Reply With Quote

#2 Old Re: validate text box with regular expression - 2009-06-22, 14:38

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by mt.jijo View Post
Hi,
Can anyone help me with how to validate text box with regular expression in pys60 with an example?

Thanks in advance
Cyan
hello mj.jijo

Please don't start multiple threads on the same issue.

Regards
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#3 Old Re: validate text box with regular expression - 2009-06-22, 16:44

Join Date: Dec 2007
Posts: 409
Location: Tempe, AZ
Send a message via Yahoo to shubhendra Send a message via Skype™ to shubhendra
shubhendra's Avatar
shubhendra
Offline
Forum Nokia Champion
You can try this

Code:
import re
text_box_pattern = re.compile(r'^(\d+).(\d+).(\d+).(\d+)$')
text_box_pattern.search('192.169.122.231').groups()
Please try this once and modify for your needs and tell if its working for you.

-Internship in France over!


IDEAS is all they need but still they think only Genius can give them that.
Reply With Quote

#4 Old Re: validate text box with regular expression - 2009-06-22, 18:35

Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
I am using the following regex:

Code:
import re
def check_ip(ip):
    pattern = r"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"
    if re.match(pattern, ip) and len(re.findall(r"[^0-9.]",ip)) == 0:
        return True
    else:
        return False


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to Fetch a web page & use regular expression to search & extract text pattern biodeb General Discussion 3 2008-08-01 08:26
Regular Expressions & Text Processing on S60 biodeb General Discussion 3 2008-08-01 08:05
javascript set focus to input text box ?? zaponjanx Browsing and Mark-ups 5 2008-03-12 10:52
how to move from list box to text editor on dialog box manjunaths Symbian User Interface 0 2006-12-07 11:13
Rich Text box cut,copy,paste system error skdas General Symbian C++ 0 2003-05-28 13:16

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia