Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Wildcards

Status
Not open for further replies.

tewari68

Programmer
Jan 25, 2005
87
US
Hi,
I have a table with email addresses list which have been blocked by the users.
When an email comes in I have to run a check against that black listed emails and see if the from address of the email is balck listed or not.
The entries in the table could be like a.b.*@yahoo.com or ab@yahoo.com or any other such combination.
I need some help in designing a query which retrieves all such combinations I am not sure how to write the query to retrieve addresses like a.b.*@yahoo.com or *.a.b@yahoo.com.

Appreciate any help.

Thanks,
Tewari
 
hi mbrooks, there could also be an entry like a.b.*@yahoo.com or *@yahoo.com.
I wouldn't know how many dots are there in the local part of the emailaddress
 
I'm not sure why you don't just compare the current string with your blacklisted addresses.

If I register as
a.b.smith@yahoo.com
and you have a blacklisted address of
absmith@yahoo.com
they aren't really the same are they? So then you are going to prevent me accessing the site when someone else is blacklisted?
 
Hi guelphdad, that's exactly the problem that I am running into, and not sure how to write a single query to overcome this problem, somebody could blacklist a.b.*@yahoo.com whereas another can block just one specific address a.b.c@yahoo.com so I have to check for both these entries and pick up the right one. I am doing all this in C++.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top