An operation is case insensitive when uppercase and lowercase characters are equally treated.
Questions tagged [case-insensitive]
1146 questions
117
votes
2 answers
Why are functions and methods in PHP case-insensitive?
Functions and methods in PHP are case-insensitive as illustrated in the following example.
function ag()
{
echo '2';
}
Ag();
class test {
function clMe()
{
echo 'hi';
}
}
$instance = new test;
$instance->clme();
But that's…

user198729
- 61,774
- 108
- 250
- 348
112
votes
10 answers
Case-insensitive search and replace with sed
I'm trying to use SED to extract text from a log file. I can do a search-and-replace without too much trouble:
sed 's/foo/bar/' mylog.txt
However, I want to make the search case-insensitive. From what I've googled, it looks like appending i to the…

Craig Walker
- 49,871
- 54
- 152
- 212
106
votes
7 answers
SQL server ignore case in a where expression
How do I construct a SQL query (MS SQL Server) where the "where" clause is case-insensitive?
SELECT * FROM myTable WHERE myField = 'sOmeVal'
I want the results to come back ignoring the case

Raul Agrait
- 5,938
- 6
- 49
- 72
97
votes
6 answers
Case insensitive search in Mongo
I am using a case insensitive search in Mongo, something similar to https://stackoverflow.com/q/5500823/1028488.
ie. I am using a regex with options i. But I am having trouble restricting the regex to just that word, it performs more like a 'Like'…

Praneeta
- 1,554
- 3
- 19
- 20
96
votes
4 answers
Case insensitive argparse choices
Is it possible to check argparse choices in case-insensitive manner?
import argparse
choices = ["win64", "win32"]
parser = argparse.ArgumentParser()
parser.add_argument("-p", choices=choices)
print(parser.parse_args(["-p", "Win32"]))
results…

Peter Petrik
- 9,701
- 5
- 41
- 65
93
votes
6 answers
How do I make jQuery Contains case insensitive, including jQuery 1.8+?
I'm trying to use "contains" case insensitively. I tried using the solution at the following stackoverflow question, but it didn't work:
Is there a case insensitive jQuery :contains selector?
For convenience, the solution is copied…

Matrym
- 16,643
- 33
- 95
- 140
89
votes
11 answers
Case insensitive std::string.find()
I am using std::string's find() method to test if a string is a substring of another. Now I need case insensitive version of the same thing. For string comparison I can always turn to stricmp() but there doesn't seem to be a stristr().
I have found…

wpfwannabe
- 14,587
- 16
- 78
- 129
88
votes
6 answers
Case insensitive string comparison
I would like to compare two variables to see if they are the same, but I want this comparison to be case-insensitive.
For example, this would be case sensitive:
if($var1 == $var2){
...
}
But I want this to be case insensitive, how would I…

Deniz Zoeteman
- 9,691
- 26
- 70
- 97
81
votes
6 answers
PostgreSQL: Case insensitive string comparison
Is there a simple ignore-case-comparison for PostgreSQL?
I want to replace:
SELECT id, user_name
FROM users
WHERE lower(email) IN (lower('adamB@a.com'), lower('eveA@b.com'));
With something like:
SELECT id, user_name
FROM users
…

Adam Matan
- 128,757
- 147
- 397
- 562
78
votes
3 answers
How to make String.Contains case insensitive?
How can I make the following case insensitive?
myString1.Contains("AbC")

CJ7
- 22,579
- 65
- 193
- 321
74
votes
2 answers
c# Dictionary: making the Key case-insensitive through declarations
I have a Dictionary dictionary. It used to be Dictionary but other 'identifiers' have come into play and the Keys are now handled as strings.
The issue is that the Guid keys from my source data are coming as VarChar,…

MoSlo
- 2,780
- 4
- 33
- 37
68
votes
9 answers
SQL SELECT LIKE (Insensitive casing)
I am trying to execute the sql query:
select * from table where column like '%value%';
But the data is saved as 'Value' ( V is capital ).
When I execute this query i don't get any rows.
How do i make the call such that, it looks for 'value'…

user2583714
- 1,097
- 2
- 11
- 18
65
votes
8 answers
Case insensitive JSON to POJO mapping without changing the POJO
Does anyone know how com.fasterxml.jackson.databind.ObjectMapper is able to map JSON properties to POJO properties case insensitive?
JSON-String:
[{"FIRSTNAME":"John","LASTNAME":"Doe","DATEOFBIRTH":"1980-07-16T18:25:00.000Z"}]
POJO-class:
public…

Mark Fellner
- 651
- 1
- 5
- 3
64
votes
8 answers
Is there a good way to have a Map get and put ignoring case?
Is there a good way to have a Map get and put ignoring case?

Joshua
- 26,234
- 22
- 77
- 106
64
votes
7 answers
Case-insensitive string startswith in Python
Here is how I check whether mystring begins with some string:
>>> mystring.lower().startswith("he")
True
The problem is that mystring is very long (thousands of characters), so the lower() operation takes a lot of time.
QUESTION: Is there a more…

Nicolas Raoul
- 58,567
- 58
- 222
- 373