Questions tagged [case-insensitive]

An operation is case insensitive when uppercase and lowercase characters are equally treated.

1146 questions
59
votes
3 answers

PHP & Case Sensitivity

In PHP, variable and constant names are case sensitive, while function names are not. As far as I am aware, PHP is the only language in which this happens. All other languages I have used are either totally case sensitive or totally case…
Manngo
  • 14,066
  • 10
  • 88
  • 110
57
votes
5 answers

How to do case-insensitive order in Rails with postgresql

I am in the process of switching my development environment from sqlite3 to postgresql 8.4 and have one last hurdle. In my original I had the following line in a helper method; result = Users.find(:all, :order => "name collate NOCASE") which…
brad
  • 9,573
  • 12
  • 62
  • 89
55
votes
3 answers

How to change spaces to underscore and make string case insensitive?

I have following question. In my app there is a listview. I get itemname from listview and transfer it to the webview as a string. How to ignore case of this string and change spaces to underscores? For example: String itemname = "First Topic". I…
Sabre
  • 4,131
  • 5
  • 36
  • 57
55
votes
2 answers

Case insensitive string comparison in Go

How do I compare strings in a case insensitive manner? For example, "Go" and "go" should be considered equal.
user7610
  • 25,267
  • 15
  • 124
  • 150
55
votes
3 answers

How do I ignore case when using startsWith and endsWith in Java?

Here's my code: public static void rightSel(Scanner scanner,char t) { /*if (!stopping)*/System.out.print(": "); if (scanner.hasNextLine()) { String orInput = scanner.nextLine; if (orInput.equalsIgnoreCase("help") { …
Matao Gearsky
  • 555
  • 1
  • 4
  • 6
54
votes
3 answers

django-orm case-insensitive order by

I know, I can run a case insensitive search from DJango ORM.…
simplyharsh
  • 35,488
  • 12
  • 65
  • 73
54
votes
7 answers

Case insensitive string replacement in JavaScript?

I need to highlight, case insensitively, given keywords in a JavaScript string. For example: highlight("foobar Foo bar FOO", "foo") should return "foobar Foo bar FOO" I need the code to work for any keyword, and therefore…
Antti Sykäri
53
votes
16 answers

Ignore case in Python strings

What is the easiest way to compare strings in Python, ignoring case? Of course one can do (str1.lower() <= str2.lower()), etc., but this created two additional temporary strings (with the obvious alloc/g-c overheads). I guess I'm looking for an…
Paul Oyster
  • 2,237
  • 3
  • 18
  • 13
53
votes
11 answers

MongoDB and C#: Case insensitive search

I am using MongoDB and the C# driver for MongoDB. I recently discovered that all queries in MongoDB are case-sensitive. How can I make a case-insensitive search? I found one way to do this: Query.Matches( "FirstName", …
Andrew Orsich
  • 52,935
  • 16
  • 139
  • 134
52
votes
4 answers

CSS selector case insensitive for attributes

If I have an HTML element a css selector needs to be case-sensitive: input[value='Search'] matches input[value='search'] does not match I need a solution where the case-insensitive approach works too. I am…
Alp
  • 29,274
  • 27
  • 120
  • 198
52
votes
3 answers

Git: File Rename

I wanted to rename a folder from "Frameworks" to "frameworks", but git would not let me add the new lowercase name. I guess it treats filenames case insensitive, does it? A git add frameworks/ -f didn't help
user187676
51
votes
12 answers

How can I make the map::find operation case insensitive?

Does the map::find method support case insensitive search? I have a map as follows: map > directory; and want the below search to ignore case: directory.find(search_string);
Ankur
  • 11,239
  • 22
  • 63
  • 66
48
votes
11 answers

Can PHP's glob() be made to find files in a case insensitive manner?

I want all CSV files in a directory, so I use glob('my/dir/*.CSV') This however doesn't find files with a lowercase CSV extension. I could use glob('my/dir/*.{CSV,csv}', GLOB_BRACE); But is there a way to allow all mixed case versions? Or is this…
alex
  • 479,566
  • 201
  • 878
  • 984
46
votes
3 answers

Using sed to delete a case insensitive matched line

How do I match a case insensitive regex and delete it at the same time I read that to get case insensitive matches, use the flag "i" sed -e "/pattern/replace/i" filepath and to delete use d sed -e "/pattern/d" filepath I've also read that I could…
eruina
  • 853
  • 3
  • 9
  • 18
45
votes
4 answers

Running a case-insensitive cypher query

Is it possible to run a case-insensitive cypher query on neo4j? Try that: http://console.neo4j.org/ When I type into this: start n=node(*) match n-[]->m where (m.name="Neo") return m it returns one row. But when I type into this: start n=node(*)…
gzg
  • 1,469
  • 6
  • 23
  • 39