regex code domain sort

i use this code: (.+?@(yahoo|xplorer|link).(?:ca|net|com))

results are:
asd@yahoo.com
asdsad@xplorer.ca
adas@earhtlink.net
asdsfsd@linkin.com


as you can see here appear: earthlink.net and also linkin.com  etc i want only @link.com
only that words MATCH CASE and not other extensions
maurice cristenAsked:
Who is Participating?
 
NerdsOfTechConnect With a Mentor Technology ScientistCommented:
That program doesn't use normal REGEX parsing with 'flags' so you will have to CASE tab 'convert word to lowercase' first, load the lower case text file in, then run the REGEX tab (retain pattern within word if you are keeping just the found emails; or remove if you are eliminating them):

((.+?@)(ciaccess\.com|cruzinternet\.com|davincibb\.net|dewinton\.ca|efirehose\.net|everus\.ca|figment\.ca|highriver\.net|highspeedfx\.net|hotlinkwireless(\.ca|\.com)|hsfx\.ca|imagewireless\.ca|lincsat\.com|link\.ca|mycanopy\.net|myipplus\.net|okotoks\.net|ourbusiness\.ca|ourmail\.ca))

Open in new window


Mission accomplished!
test.txt
test---Lower-Case.txt
test---Lower-Case---Regex-Retain-Fro.txt
0
 
NerdsOfTechTechnology ScientistCommented:
If you want just @link.com emails, use:
(.+?@link\.com)

Open in new window


1st Capturing Group (.+?@link\.com)

.+? matches any character (except for line terminators)

+? Quantifier — Matches between one and unlimited times, as few times as possible, expanding as needed (lazy)

@link matches the characters @link literally (case sensitive)

\. matches the character . literally (case sensitive)

com matches the characters com literally (case sensitive)

I recommend making it case insensitive:
/(.+?@link\.com)/i

Open in new window


i modifier: insensitive. Case insensitive match
0
 
maurice cristenAuthor Commented:
i want also this, all this filetr at the same time :
ciaccess.com
cruzinternet.com
davincibb.net
dewinton.ca
efirehose.net
everus.ca
figment.ca
highriver.net
highspeedfx.net
hotlinkwireless.ca
hotlinkwireless.com
hsfx.ca
imagewireless.ca
lincsat.com
link.ca
mycanopy.net
myipplus.net
okotoks.net
ourbusiness.ca
ourmail.ca

Open in new window

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
NerdsOfTechTechnology ScientistCommented:
Please reply to the thread.

this is the lsit i want toe xtract, all at the same time:
xplornet.com
xplornet.ca
aernet.ca
airsurfer.ca
albertahighspeed.ca
albertahighspeed.com
albertahighspeed.net
bears-paw.ca
canopycanada.net
ciaccess.com
cruzinternet.com
davincibb.net
dewinton.ca
efirehose.net
everus.ca
figment.ca
highriver.net
highspeedfx.net
hotlinkwireless.ca
hotlinkwireless.com
hsfx.ca
imagewireless.ca
lincsat.com
link.ca
mycanopy.net
myipplus.net
okotoks.net
ourbusiness.ca
ourmail.ca
pcc-inet.ca
platinum.ca
platinumcommunications.net
priddis.ca
ripnet.com
rttinc.com
skyvelocity.ca
southkent.net
spring-bank.ca
talkwireless.ca
tbwifi.ca
wildroseinternet.ca
wildrosenet.ca
wildrosenetworks.ca
yourlink.ca


i tried to use this:
(.+?@aernet|airsurfer|albertahighspeed|bears-paw|canopycanada|ciaccess|cruzinternet|davincibb|dewinton|efirehose|everus|figment|highriver|highspeedfx|hotlinkwireless|hsfx|imagewireless|lincsat|link|mycanopy|myipplus|okotoks|ourbusiness|ourmail|pcc-inet|platinum|platinumcommunications|priddis|ripnet|rttinc|skyvelocity|southkent|spring-bank|talkwireless|tbwifi|wildroseinternet|wildrosenet|wildrosenetworks|yourlink).(?:ca|com|net))

but i have a problem here,let's take as example:@yourlink.com
output look like this:

sds@yourlink.com
asdas@earthlink.com
sadsa@link.net

you see?
i want only --> yourlink.com

/(.+?@)(aernet|airsurfer|albertahighspeed|bears-paw|canopycanada|ciaccess|cruzinternet|davincibb|dewinton|efirehose|everus|figment|highriver|highspeedfx|hotlinkwireless|hsfx|imagewireless|lincsat|link|mycanopy|myipplus|okotoks|ourbusiness|ourmail|pcc-inet|platinum|platinumcommunications|priddis|ripnet|rttinc|skyvelocity|southkent|spring-bank|talkwireless|tbwifi|wildroseinternet|wildrosenet|wildrosenetworks|yourlink)\.(ca|com|net)/i

Open in new window

0
 
NerdsOfTechTechnology ScientistCommented:
Now the REGEX I gave previously, is for (your list) and (ca, com, or net wildcard). If you want more restrictive filtering, which is always best, use EXACT domains in the 2nd capture area:

/(.+?@)(ciaccess\.com|cruzinternet\.com|davincibb\.net|dewinton\.ca|efirehose\.net|everus\.ca|figment\.ca|highriver\.net|highspeedfx\.net|hotlinkwireless(\.ca|\.com)|hsfx\.ca|imagewireless\.ca|lincsat\.com|link\.ca|mycanopy\.net|myipplus\.net|okotoks\.net|ourbusiness\.ca|ourmail\.ca)/i

Open in new window


This will match link.ca but not link.com
0
 
maurice cristenAuthor Commented:
this code not working:

/(.+?@)(ciaccess\.com|cruzinternet\.com|davincibb\.net|dewinton\.ca|efirehose\.net|everus\.ca|figment\.ca|highriver\.net|highspeedfx\.net|hotlinkwireless(\.ca|\.com)|hsfx\.ca|imagewireless\.ca|lincsat\.com|link\.ca|mycanopy\.net|myipplus\.net|okotoks\.net|ourbusiness\.ca|ourmail\.ca)/i

Open in new window

0
 
NerdsOfTechTechnology ScientistCommented:
Which programming language are you using?

Should work for PHP, PCRE, Python, Golang and JavaScript

I'm showing it working:

https://www.regextester.com/?fam=99775
0
 
maurice cristenAuthor Commented:
yes,thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.