BigEfromDaBX 25 Posted March 27, 2015 Report Share Posted March 27, 2015 Hi Im trying to capture the .com .net .us in an email address. My regex works fine but it when I come across emails that have a subdomain it picks up the domain part after the period of the sub domain. Here is my regex (?<=[-_.0-9a-zA-Z]+@[-0-9a-zA-Z]+)\.[0-9a-zA-Z]+ Here is my example: set(#emails,"AccreditedOnlinePsychologyDegrees@smallnach.science EducationOnline@smallnach.science info@twitter.com joe.schmoe@yahoo.com goeorge@mail.yahoo.com BellyBuster@now.netjewi.eu news@news.punchingbagnews.com Vydox@low.fluentr.eu big-john@yo.com Best-Carb-Preventer@ray235.growartistdiet.us","Global") set(#tld,$find regular expression(#emails,"(?<=[-_.0-9a-zA-Z]+@[-0-9a-zA-Z]+)\\.[0-9a-zA-Z]+"),"Global") Quote Link to post Share on other sites
Pete 121 Posted March 27, 2015 Report Share Posted March 27, 2015 Try this (?<=\.)[a-zA-Z]+$ Quote Link to post Share on other sites
BigEfromDaBX 25 Posted March 28, 2015 Author Report Share Posted March 28, 2015 Try this (?<=\.)[a-zA-Z]+$Doesnt work. That only returns us Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted March 28, 2015 Report Share Posted March 28, 2015 in first find regex node use@.* that gets @blah.blah.com then use replace regex nodeuse@.*\..*\.|@.*\.and replace with $nothing leaves you withnetcometc you want to do it htis way in case you have 2-5 letter root like "yo" in the replace node you can "stack" the $find regex in the $replace regex orifinal text field. sorry dont have ubot installed at the momenthope that makes sense CD ***** I edited replace regex Quote Link to post Share on other sites
BigEfromDaBX 25 Posted March 28, 2015 Author Report Share Posted March 28, 2015 in first find regex node use@.* that gets @blah.blah.com then use replace regex nodeuse@.*\..*\.and replace with $nothing leaves you withnetcometc you want to do it htis way in case you have 2-5 letter root like "yo" in the replace node you can "stack" the $find regex in the $replace regex orifinal text field. sorry dont have ubot installed at the momenthope that makes sense CD Yes CD it makes sense. Its just that when I stop using ubot for a while and come back I forget everything lol. It worked perfect.. Thanks 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted March 28, 2015 Report Share Posted March 28, 2015 here you go set(#emails, "AccreditedOnlinePsychologyDegrees@smallnach.scienceEducationOnline@smallnach.scienceinfo@twitter.comjoe.schmoe@yahoo.comgoeorge@mail.yahoo.comBellyBuster@now.netjewi.eunews@news.punchingbagnews.comVydox@low.fluentr.eubig-john@yo.comBest-Carb-Preventer@ray235.growartistdiet.usme@mmeme.yo.com", "Global")set(#find, $find regular expression(#emails, "@.*"), "Global")alert(#find)set(#replace, $replace regular expression(#find, "@.*\\..*\\.|@.*\\.", $nothing), "Global")alert(#replace)alert($replace regular expression($find regular expression(#emails, "@.*"), "@.*\\..*\\.|@.*\\.", $nothing)) CD Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted March 28, 2015 Report Share Posted March 28, 2015 wuh? stray from ubot? how dare you!! just kidding ya, I have been mostly in Python myself glad it helped CD Quote Link to post Share on other sites
BigEfromDaBX 25 Posted March 29, 2015 Author Report Share Posted March 29, 2015 wuh? stray from ubot? how dare you!! just kidding ya, I have been mostly in Python myself glad it helped CD Programming is not something I do all the time. Im mostly a graphic designer/ printer . 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.