Regular Expression -Gmail ID

208 views
Skip to first unread message

suhail khan

unread,
Apr 29, 2012, 10:15:04 AM4/29/12
to mercuryqtp
Dear All

how to write regular expression of Gmail id like suhai...@gmail.com
in this @gmail.com would remain the same
characters before @ is variable ie keep changing

appreciate any help

regards
suhail

Deepak Kumar Mahapatro

unread,
Apr 29, 2012, 2:01:40 PM4/29/12
to mercu...@googlegroups.com
([\w|\d]+[\.]?){1,}[\w|\d]+[@][g][m][a][i][l][\.][c][o][m]

this will work better

On Sun, Apr 29, 2012 at 11:28 PM, Deepak Kumar Mahapatro <deepakkumar...@gmail.com> wrote:
([\w|\d]+[\.]?[\w|\d]+)+[@][g][m][a][i][l][\.][c][o][m]


suhail

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Regards,
Deepak



--
Regards,
Deepak

Deepak Kumar Mahapatro

unread,
Apr 29, 2012, 1:58:02 PM4/29/12
to mercu...@googlegroups.com
([\w|\d]+[\.]?[\w|\d]+)+[@][g][m][a][i][l][\.][c][o][m]

On Sun, Apr 29, 2012 at 7:45 PM, suhail khan <suhai...@gmail.com> wrote:
suhail

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Regards,
Deepak

Santosh S

unread,
Apr 30, 2012, 1:17:59 AM4/30/12
to mercu...@googlegroups.com
Can u explain this :
([\w|\d]+[\.]?){1,}[\w|\d]+[@][g][m][a][i][l][\.][c][o][m]

Anish Pillai

unread,
Apr 30, 2012, 10:01:44 AM4/30/12
to mercu...@googlegroups.com
Hi,

\w means alphanumeric characters(A-Z, a-z, 0-9) including underscore(_). Like an_12
\d means numbers 0 to 9. Like 10110

[\w|\d] means either \w or \d. Like an_12

[\w|\d]+ means 1 more more occurences of the character(s) before +. Ex - an_12an_12

[\.]? means 0 or 1 occurrence of the character preceding ?, which is dot(.) in this case.

[\w|\d]+[\.]? can mean ani_123.

{1,} means 1 more or occurence of preceding character.

([\w|\d]+[\.]?){1,} means 1 or more occurrence of ([\w|\d]+[\.]?) Example ani_123.ani_123.ani_123.

[\w|\d]+ means 1 more more occurences of the character(s) before +. Ex - kumar_112

([\w|\d]+[\.]?){1,}[\w|\d]+ can become ani_123.kumar_112

[@][g][m][a][i][l][\.][c][o][m] means "@gmail.com"


Combining everything we get ani_123....@gmail.com


For more regular expression operators, check the below link.

http://www.automationrepository.com/2011/08/all-about-regular-expressions-in-qtp/



--
ar

Deepak Kumar Mahapatro

unread,
Apr 30, 2012, 1:45:54 PM4/30/12
to mercu...@googlegroups.com
gmail

On Mon, Apr 30, 2012 at 11:15 PM, Deepak Kumar Mahapatro <deepakkumar...@gmail.com> wrote:
sorry mail is not accepting _. so you can replace "\w" with "A-Z|a-z" 



--
Regards,
Deepak

Deepak Kumar Mahapatro

unread,
Apr 30, 2012, 1:45:41 PM4/30/12
to mercu...@googlegroups.com
sorry mail is not accepting _. so you can replace "\w" with "A-Z|a-z" 

--
Regards,
Deepak
Reply all
Reply to author
Forward
0 new messages