how do u make a search so it's not case sensitive - another one i'm in the dark on

They have: 850 posts

Joined: Jul 1999

/i

----------
[red][Rob P][/red]
[[email protected]]--[[icq]16560402[/icq]]

They have: 69 posts

Joined: Apr 1999

Since robp's answer wasn't very descriptive, I'll expand a bit more.

When you are doing a regexp (regular expression), you can specify many options that tell PERL how should it match. The i option specifies that the search/match should be done in case insensitive, just like the g options specifies to match all occurrencies of a string.

The option must be right after the closing delimiter, in robp's case, the slash.

Here's an example:

if ($text =~ /$searchstring/i) { print "We have found the string \"$searchstring\" in our page." }
else { print "Sorry, no matches for \"$searchstring\". }

Regards,
Federico Carnales

----------
Reviews of the best resources for webmasters in your e-mail every week!
Subscribe for [red]FREE[/red] by going to http://www.web-reviews.com/

They have: 1,587 posts

Joined: Mar 1999

same database i've asked another question about. there's a member search feature. however, if you don't type the member's name in exactly as it is in the database it says they don't exist.

what's the simple code to look for both capital and non-capitol spellings of the same word?

thanks in advance Wink

----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 1,587 posts

Joined: Mar 1999

very helpful, thanks Wink

----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com

They have: 1,587 posts

Joined: Mar 1999

i'm having one problem with the code above. it recognizes the following 2 names as the same name "michael" and "michael27". any ideas how to correct this?

thanks in advance Wink

----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com

Traffic-Website.com free traffic, affiliate programs, hosting, & domain names.
My Site got hacked, but i'm coming back?

They have: 297 posts

Joined: Apr 1999

You could make both strings lower case and compare them afterwards.

Later,

Malte

----------
Malte Ubl - [red]Germany[/red] - http://goKewl.com/
[red]The beats of 1000 hearts inside...[/red] the merciless pulsation... [red]and all I know is I'll be back...[/red] back to trance nation!

They have: 69 posts

Joined: Apr 1999

fairhousing,

I'm not sure of the way you are doing the search on the databases, but say, if you are going through each line and getting different fields based on a delimiter, and you want to match exact strings on a specified field, then the code should be like:

if (lc($text) eq lc($searchstring)) { print "We have found the string \"$searchstring\" in ourpage." }
else { print "Sorry, no matches for \"$searchstring\". }

The lc function returns the lower case version of the string/variable, making the comparison case insensitive.

Regards.

----------
Reviews of the best resources for webmasters in your e-mail every week!
Subscribe for [red]FREE[/red] by going to http://www.web-reviews.com/

They have: 1,587 posts

Joined: Mar 1999

thanks again Wink

----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com

They have: 1,587 posts

Joined: Mar 1999

just letting you know it works like a charm that way. thanks a bunch. Wink

----------
My Site Got Hacked, Check It Out!
http://www.birminghamnet.com

They have: 69 posts

Joined: Apr 1999

You're welcome Smiling

----------
Reviews of the best resources for webmasters in your e-mail every week!
Subscribe for [red]FREE[/red] by going to http://www.web-reviews.com/

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.