Questions tagged [case-insensitive]

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

1146 questions
43
votes
4 answers

How to perform case insensitive diff in Git

git diff does not support a case-insensitive comparison of files. Google shows a very few people asking for that feature, and that too only in combination with some other git diff switch, like with -G or with --color-words. I don't care for other…
Gurjeet Singh
  • 2,635
  • 2
  • 27
  • 22
42
votes
1 answer

What is the most efficient case-insensitive grep usage?

My objective is to match email addresses that belong to the Yahoo! family of domains. In *nix systems (I will be using Ubuntu), what are the benefits and drawbacks to any one of these methods for matching the pattern? And if there is another, more…
bebingando
  • 1,022
  • 1
  • 8
  • 12
40
votes
9 answers

Javascript: highlight substring keeping original case but searching in case insensitive mode

I'm trying to write a "suggestion search box" and I cannot find a solution that allows to highlight a substring with javascript keeping the original case. For example if I search for "ca" I search server side in a case insensitive mode and I have…
Giovanni Di Milia
  • 13,480
  • 13
  • 55
  • 67
39
votes
9 answers

How can I have case insensitive URLS in Spring MVC with annotated mappings

I have annotated mappings working great through my spring mvc web app, however, they are case sensitive. I cannot find a way to make them case insensitive. (I'd love to make this happen within Spring MVC, rather than redirecting traffic somehow)
Dave
  • 391
  • 1
  • 3
  • 3
38
votes
3 answers

str_ireplace() with keeping of case

How can I use str_ireplace (or something similar) to replace some text for formatting and then return it with the same caps? Example: $original="The quick red fox jumps over the lazy brown dog."; $find="thE"; print…
Francisc
  • 77,430
  • 63
  • 180
  • 276
38
votes
4 answers

Case insensitive string search in golang

How do I search through a file for a word in a case insensitive manner? For example If I'm searching for UpdaTe in the file, if the file contains update, the search should pick it and count it as a match.
user3841581
  • 2,637
  • 11
  • 47
  • 72
38
votes
6 answers

How to compare character ignoring case in primitive types

I am writing these lines of code: String name1 = fname.getText().toString(); String name2 = sname.getText().toString(); aru = 0; count1 = name1.length(); count2 = name2.length(); for (i = 0; i < count1; i++) { for (j = 0; j < count2; j++) …
Arush Kamboj
  • 673
  • 3
  • 10
  • 20
37
votes
1 answer

Are character set names case-sensitive in HTTP?

This is a follow-up to Are HTTP headers case-sensitive?. In the HTTP Content-Type header, I have seen character set names expressed both in upper- and lower-case form. For example, for the UTF-8 character set: Content-Type: text/html;…
DavidRR
  • 18,291
  • 25
  • 109
  • 191
36
votes
3 answers

mod_rewrite RewriteCond - is NC flag necessary for just domain part? And some more

I have seen many times in htaccess these type of rules : RewriteCond %{HTTP_REFERER} !^http://www.domain.it$ [NC] or RewriteCond %{HTTP_HOST} !^www\.domain\.it$ [NC] Why is the NC flag necessary, when checking only the domain part? I noticed…
Marco Demaio
  • 33,578
  • 33
  • 128
  • 159
36
votes
7 answers

Return only duplicated entries from an array (case-insensitive)

I want to retrieve all case-insensitive duplicate entries from an array. Is this possible in PHP? array( 1 => '1233', 2 => '12334', 3 => 'Hello', 4 => 'hello', 5 => 'U' ); Desired output array: array( 1 => 'Hello', 2 =>…
coderex
  • 27,225
  • 45
  • 116
  • 170
34
votes
8 answers

Is there a reason to use uppercase letters for hexadecimal CSS color values?

I see that colors in CSS properties values are commonly written in the uppercase form: .foo .bar { background-color: #A41B35; color: #FFF; } But you can also use: /* Same same */ .foo .bar { background-color: #a41b35; color: #fff; } Or…
smonff
  • 3,399
  • 3
  • 36
  • 46
33
votes
2 answers

case insensitive in regex in postgresql query

I want to search for a list of name through records of another table i want that my regex be case insensitive, but I can not make it work! SELECT id FROM "regexfreeFlickrFullInfo" where tags ~ 'tower\s?\*?bridge' or title ~ 'tower\s?\*?bridge'…
GeoBeez
  • 920
  • 2
  • 12
  • 20
30
votes
3 answers

Underscore.js Case Insensitive Sorting

Having some slight issues trying to get underscore.js to do case-insensitive sorting. I have an array of objects and would like to be able to sort by property name. Using shortcut method sortBy iteratee may also be the string name of the property…
user1549008
30
votes
3 answers

Changing Filename Case with TortoiseSVN on Windows

I've been working on a development project using a Windows machine as a test server. Eventually, I'd like the "live" version to end up on a Linux machine. While trying to test on the Linux machine, it became apparent that I needed to change the case…
Brad Turner
  • 438
  • 1
  • 4
  • 9
29
votes
3 answers

Querying MongoDB (via pymongo) in case insensitive efficiently

I'm currently creating a website in python (pyramid) which requires users to sign up and log in. The system allows for users to choose a username which can be a mixture of capital letters, lowercase letters, and numbers. The problem arises when…
johneth
  • 2,858
  • 5
  • 27
  • 26