How can we validate email id in Sikuli tool

Asked by Santhosh Motamarry

Hi,

How can we write script for validating email id while registering and also login into a web site.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

It is really not fun, to try to answer your questions, since you are hopping from comments to new questions and vice versa.

Pls. decide to stick to one question representing one subject until it is solved.

So this new question is a duplicate to:
https://answers.launchpad.net/sikuli/+question/177209

which I set to solved.

So lets try to find out how we can help you now in this thread.

Revision history for this message
RaiMan (raimund-hocke) said :
#2

did you already try to use the hints from
look: https://answers.launchpad.net/sikuli/+question/176960

Revision history for this message
Santhosh Motamarry (santhosh-motamarry) said :
#3

ya raiman i tried the hints in 176960 but it is only for validating password na

Revision history for this message
Santhosh Motamarry (santhosh-motamarry) said :
#4

not email validation i need email validation too

Revision history for this message
RaiMan (raimund-hocke) said :
#5

Ok, then you have to build the needed regular expression to test the email given.

Feel free to come back with your trials, if you are really not able to get on the road.

Revision history for this message
Santhosh Motamarry (santhosh-motamarry) said :
#6

hi raiman i have tried the below line of code for email validation but it is showing some error.

test_email =re.compile( /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)

Revision history for this message
Best RaiMan (raimund-hocke) said :
#7

ok, here you are:

import re
test_email =re.compile('^([a-zA-Z0-9_.-]+)\@([a-zA-Z0-9-]+\.[a-zA-Z0-9]{2,4})$')
m = re.match(test_email, "r.ho@x.com")
print m.groups()

prints:
('r.ho', 'x.com')

*** comments
-- re.compile needs a string (so do not enclose the regex in / )
-- characters inside [ ] need not be escaped with \ (only the ] if needed)
-- if you do not need the matched content afterwards, the regex does not need any ( ):
test_email =re.compile('^[a-zA-Z0-9_.-]+\@[a-zA-Z0-9-]+\.[a-zA-Z0-9]{2,4}$')

Revision history for this message
Santhosh Motamarry (santhosh-motamarry) said :
#8

Thanks RaiMan, that solved my question.