473,394 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Wildcard Question

Hi, all!

On my "Recent Visits" list, I try to exclude all *.googlebot.com and the
like.
Now, I tried the following:

if (($HOST != "*.blah.com")
AND ($HOST != "*.googlebot.com")
AND ($HOST != "*.inktomisearch.com"))
{
// log this host
}

Nevertheless, it doesn't work.
How would I use the wildcard? I did not find any documentation on
wildcards.

Anyone willing to help? Thanks!

HSS
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
Jul 17 '05 #1
4 11239
On 2004-01-24, Hans-Stefan Suhle <Bo***********@Suhle.de> wrote:
Hi, all!

On my "Recent Visits" list, I try to exclude all *.googlebot.com and the
like.
Now, I tried the following:

if (($HOST != "*.blah.com")
AND ($HOST != "*.googlebot.com")
AND ($HOST != "*.inktomisearch.com"))
{
// log this host
}

Nevertheless, it doesn't work.
How would I use the wildcard? I did not find any documentation on
wildcards.


You'll find more when you start looking for "regular expression".

But if you only need to compare the ending of a string, you could do it
with substr to and strlen too.

Get the length of ".blah.com" into $len
Compare with the last $len characters of $HOST.
--
http://home.mysth.be/~timvw
Jul 17 '05 #2
Hans-Stefan Suhle wrote:
if (($HOST != "*.blah.com")
AND ($HOST != "*.googlebot.com")
AND ($HOST != "*.inktomisearch.com")) How would I use the wildcard? I did not find any documentation on
wildcards.


There's no documentation because there are no wildcards in string
comparisons. You could user preg_match() to that effect.

Jochen
Jul 17 '05 #3
There's a function called fnmatch that does what you want (it's in the
freaking manual!!!). It's only found in PHP v.4.3+ and only on *nix
versions.

Uzytkownik "Hans-Stefan Suhle" <Bo***********@Suhle.de> napisal w wiadomosci
news:pa****************************@Suhle.de...
Hi, all!

On my "Recent Visits" list, I try to exclude all *.googlebot.com and the
like.
Now, I tried the following:

if (($HOST != "*.blah.com")
AND ($HOST != "*.googlebot.com")
AND ($HOST != "*.inktomisearch.com"))
{
// log this host
}

Nevertheless, it doesn't work.
How would I use the wildcard? I did not find any documentation on
wildcards.

Anyone willing to help? Thanks!

HSS
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

Jul 17 '05 #4
On Sat, 24 Jan 2004 19:51:00 -0500, Chung Leong wrote:
There's a function called fnmatch that does what you want (it's in the
freaking manual!!!). It's only found in PHP v.4.3+ and only on *nix
versions.

Thank you all for your help!
I solved it this way: (not confirmed yet to be working)

if ((fnmatch ("*.blah.com", $HOST))
AND (fnmatch ("*.googlebot.com", $HOST))
AND (fnmatch ("*.inktomisearch.com", $HOST)))
{
break;
}
else
{
//log this host
}

HSS
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Generic Usenet Account | last post by:
Here's the requirement that I am trying to satisfy: Handle wildcards in STL such that the wildcard entry is encountered before non-wildcard entries while traversing containers like sets and...
1
by: deko | last post by:
I have a form where users can enter a string with asterisks to perform a wildcard search. Currently, the string entered by the user looks like this: *somestring* The purpose is to match any...
3
by: Adam | last post by:
Its my understanding that in asp.net 2.0 you can write an httpmodule that will acts as a wildcard handler and pass requests on to the proper engine, for instance, asp or perl for example, In the...
2
by: JohnT | last post by:
Okay... I'm using VB.net (2003) and I am accessing an MS Access DB file. I have two DataAdapters that I use to search for specific info. The two of them are similar except one is a Date, the...
7
by: SlimFlem | last post by:
I have searched hard for 2 days on this and keep hitting a wall. I have a custom IHttpHandler setup to do Url mappings to prop up some old Urls for our site. I have also created a wildcard...
6
by: mabond | last post by:
Hi Is it possible to compare a vaule for a select case statement using a wildcard. e.g. somthing like Select case myValue case like "*ing" end select
2
by: guoqi zheng | last post by:
Dear Sir, I would like all files on my application to pass asp.net, so I added aspnet_isapi.dll to the Wildcard application maps. After that, many things changed. I used to be able to visit my...
6
by: Jan Kucera | last post by:
Hi, does anybody know about wildcard mapping ASP.NET 2 in IIS6? Any tutorial? Thanks, Jan
1
by: Lucvdv | last post by:
In my assembly.vb files, I'm using the revision/build wildcard style: <Assembly: AssemblyVersion("3.0.*")> <Assembly: AssemblyFileVersion("3.0.*")> This onkly seems to work in projects that...
7
by: BlackJack17 | last post by:
I have another newbie question for you guys... I apologize in advance for how simple it is... I've got a string of data, included in that string is 11* as it appears, the * is not a wildcard. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.