RATPFINK 3 Posted December 23, 2015 Report Share Posted December 23, 2015 Hello allI am trying to work out the regex to find a gmail address similar to u.ser.nam.e@gmail.com. It has to return only addresses that contain multiple periods in them instead of the traditional username@gmail.com. I can only figure out how to match multiple periods in a row as opposed to anywhere within the string.Help would be much appreciated. Quote Link to post Share on other sites
pash 504 Posted December 23, 2015 Report Share Posted December 23, 2015 try. add list to list(%Gmail,$find regular expression("u.ser.nam.e@gmail.com user_name@gmail.com username@gmail.com",".*?@gmail.com"),"Delete","Global") 1 Quote Link to post Share on other sites
RATPFINK 3 Posted December 27, 2015 Author Report Share Posted December 27, 2015 try. add list to list(%Gmail,$find regular expression("u.ser.nam.e@gmail.com user_name@gmail.com username@gmail.com",".*?@gmail.com"),"Delete","Global")That's not working. Quote Link to post Share on other sites
deliter 203 Posted December 28, 2015 Report Share Posted December 28, 2015 find the "Right" regular expression or email validation expression is notoriously difficult,unfortunately for you I absolutely suck at regular expressions,what might be easier is use a normal regular expression for emails and at the end of the operation loop through the list and add any list item that contains a "." before the @ to a new list,but hopefully somebody will post the expression that you need 1 Quote Link to post Share on other sites
pash 504 Posted December 28, 2015 Report Share Posted December 28, 2015 if you want convert "u.ser.nam.e@gmail.com" to "username@gmail.com" set(#mail,$replace($find regular expression("u.ser.nam.e@gmail.com us.ername@gmail.com username@gmail.com",".*?@gmail.com"),".",""),"Global") add list to list(%Gmail,$list from text(#mail,$new line),"Delete","Global")if find only have "." alert($find regular expression("u.ser.nam.e@gmail.com us.ername@gmail.com username@gmail.com",".*\\..*?@gmail.com")) Quote Link to post Share on other sites
RATPFINK 3 Posted December 28, 2015 Author Report Share Posted December 28, 2015 if you want convert "u.ser.nam.e@gmail.com" to "username@gmail.com" set(#mail,$replace($find regular expression("u.ser.nam.e@gmail.com us.ername@gmail.com username@gmail.com",".*?@gmail.com"),".",""),"Global") add list to list(%Gmail,$list from text(#mail,$new line),"Delete","Global")if find only have "." alert($find regular expression("u.ser.nam.e@gmail.com us.ername@gmail.com username@gmail.com",".*\\..*?@gmail.com"))That should work since it's using look ahead to find any periods within the username. For whatever reason it doesn't though. I have never been able to figure out why some expressions work in rubular but not in ubot. Quote Link to post Share on other sites
munio 0 Posted December 28, 2015 Report Share Posted December 28, 2015 This is good pattern: ^\w+[\w-\.]*\@gmail.com Quote Link to post Share on other sites
RATPFINK 3 Posted December 29, 2015 Author Report Share Posted December 29, 2015 This is good pattern: ^\w+[\w-\.]*\@gmail.comIt worked when I removed the start of string. Thanks so much. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.