An operation is case insensitive when uppercase and lowercase characters are equally treated.
Questions tagged [case-insensitive]
1041 questions
3106
votes
28 answers
Case insensitive 'Contains(string)'
Is there a way to make the following return true?
string title = "ASTRINGTOTEST";
title.Contains("string");
There doesn't seem to be an overload that allows me to set the case sensitivity.. Currently I UPPERCASE them both, but that's just silly (by…
![](../../users/profiles/11333.webp)
Boris Callens
- 82,870
- 79
- 201
- 297
1777
votes
15 answers
How to do case insensitive search in Vim
I'd like to search for an upper case word, for example COPYRIGHT in a file. I tried performing a search like:
/copyright/i # Doesn't work
but it doesn't work. I know that in Perl, if I give the i flag into a regex it will turn the regex into a…
![](../../users/profiles/157300.webp)
Haiyuan Zhang
- 36,164
- 38
- 101
- 131
637
votes
11 answers
How do I do a case-insensitive string comparison?
How can I do case insensitive string comparison in Python?
I would like to encapsulate comparison of a regular strings to a repository string using in a very simple and Pythonic way. I also would like to have ability to look up values in a dict…
![](../../users/profiles/52490.webp)
Kozyarchuk
- 18,211
- 13
- 38
- 46
452
votes
14 answers
Contains case insensitive
I have the following:
if (referrer.indexOf("Ral") == -1) { ... }
What I like to do is to make Ral case insensitive, so that it can be RAl, rAl, etc. and still match.
Is there a way to say that Ral has to be case-insensitive?
![](../../users/profiles/996431.webp)
Nate Pet
- 38,422
- 114
- 251
- 393
410
votes
9 answers
Case insensitive regular expression without re.compile?
In Python, I can compile a regular expression to be case-insensitive using re.compile:
>>> s = 'TeSt'
>>> casesensitive = re.compile('test')
>>> ignorecase = re.compile('test', re.IGNORECASE)
>>>
>>> print casesensitive.match(s)
None
>>> print…
![](../../users/profiles/42974.webp)
Mat
- 67,636
- 33
- 83
- 106
338
votes
24 answers
MongoDB: Is it possible to make a case-insensitive query?
Example:
> db.stuff.save({"foo":"bar"});
> db.stuff.find({"foo":"bar"}).count();
1
> db.stuff.find({"foo":"BAR"}).count();
0
![](../../users/profiles/24010.webp)
Luke Dennis
- 13,172
- 17
- 52
- 66
333
votes
11 answers
How to set Sqlite3 to be case insensitive when string comparing?
I want to select records from sqlite3 database by string matching. But if I use '=' in the where clause, I found that sqlite3 is case sensitive. Can anyone tell me how to use string comparing case-insensitive?
![](../../users/profiles/87955.webp)
quantity
- 3,771
- 3
- 21
- 20
328
votes
15 answers
How can I search (case-insensitive) in a column using LIKE wildcard?
I looked around some and didn't find what I was after so here goes.
SELECT * FROM trees WHERE trees.`title` LIKE '%elm%'
This works fine, but not if the tree is named Elm or ELM etc...
How do I make SQL case insensitive for this wild-card…
![](../../users/profiles/279558.webp)
David Morrow
- 7,448
- 4
- 27
- 24
317
votes
5 answers
How do you do a case insensitive search using a pattern modifier using less?
It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work
/something to search for/i
![](../../users/profiles/1797.webp)
mk.
- 24,966
- 13
- 35
- 40
283
votes
12 answers
Case-insensitive search
I'm trying to get a case-insensitive search with two strings in JavaScript working.
Normally it would be like this:
var string="Stackoverflow is the BEST";
var result= string.search(/best/i);
alert(result);
The /i flag would be for…
![](../../users/profiles/25741.webp)
Chris Boesing
- 5,159
- 3
- 24
- 30
257
votes
15 answers
How to perform case-insensitive sorting in JavaScript?
I have an array of strings I need to sort in JavaScript, but in a case-insensitive way. How to perform this?
![](../../users/profiles/520957.webp)
Jérôme Verstrynge
- 51,859
- 84
- 263
- 429
239
votes
6 answers
Case insensitive searching in Oracle
The default behaviour of LIKE and the other comparison operators, = etc is case-sensitive.
Is it possible make them case-insensitive?
![](../../users/profiles/170830.webp)
sergionni
- 12,462
- 41
- 121
- 182
229
votes
9 answers
How can I do a case insensitive string comparison?
How can I make the line below case insensitive?
drUser["Enrolled"] =
(enrolledUsers.FindIndex(x => x.Username == (string)drUser["Username"]) != -1);
I was given some advice earlier today that suggested I use:…
![](../../users/profiles/376711.webp)
Jamie
- 2,307
- 2
- 13
- 3
219
votes
19 answers
Case-insensitive search in Rails model
My product model contains some items
Product.first
=> #
I'm now importing some product parameters from another dataset, but there are inconsistencies in the spelling of the names. For instance, in the other…
![](../../users/profiles/109305.webp)
Jesper Rønn-Jensen
- 91,561
- 40
- 112
- 147
202
votes
10 answers
Case insensitive replace
What's the easiest way to do a case-insensitive string replacement in Python?
![](../../users/profiles/79.webp)
Adam Ernst
- 45,666
- 17
- 55
- 71