| Reply | « Previous Thread | Next Thread » |
|
Hi,
Can anyone help me with how to validate text box with regular expression in pys60 with an example? Thanks in advance Cyan |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
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 |
|
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()
-Internship in France over! IDEAS is all they need but still they think only Genius can give them that. |
| shubhendra |
| View Public Profile |
| Find all posts by shubhendra |
|
Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |