case-insensitive

Is the “Contains” Delphi string helper case sensitive?

柔情痞子 提交于 2019-12-07 11:59:08
问题 Delphi XE3 introduced a Contains string helper function, but the help-file/wiki does not state whether it is case sensitive or not? 回答1: Yes it is case sensitive. Quick test: ShowMessage('TEST'.Contains('t').ToString(TUseBoolStrs.True)); returns False Use ToLowerInvariant or ToUpperInvariant to compare case insensitive: ShowMessage('TEST'.ToLowerInvariant.Contains('t').ToString(TUseBoolStrs.True)); 来源: https://stackoverflow.com/questions/30180634/is-the-contains-delphi-string-helper-case

Case insensitive regex in Bash

夙愿已清 提交于 2019-12-07 09:05:56
问题 I want to know which method is better to check if a var (input by user on keyboard) matches with a regex in a case insensitive way. I know there are some different possibilities. Example: I want a regex matching an empty value and all of this list: Y , N , y , n , Yes , No , YES , NO I searched looking different methods. Not sure if could be another better. I'll put a couple of them working for me. First one is a little "tricky" setting all to uppercase for the comparison: #!/bin/bash yesno=

how can I write a case-insensitive find_by_email for Rails 3

拥有回忆 提交于 2019-12-07 08:27:08
问题 I found that if a user registers with an email and use a capital letter in their email when I do the following I get nil. Example: username = Dillan@example.com params[:user][:email] = dillan@example.com user = User.find_by_email(params[:user][:email]) user.nil? => true How can I search for an email without the problems of case sensitivity or how an I write a find_by_email that is case insensitive? 回答1: If a user(say X) has an email 'Dillan@example.com', then User.find(:all, :conditions => [

Anyone had success using a specific locale for a PostgreSQL database so that text comparison is case-insensitive?

空扰寡人 提交于 2019-12-07 05:28:21
问题 I'm developing an app in Rails on OS X using PostgreSQL 8.4. I need to setup the database for the app so that standard text queries are case-insensitive. For example: SELECT * FROM documents WHERE title = 'incredible document' should return the same result as: SELECT * FROM documents WHERE title = 'Incredible Document' Just to be clear, I don't want to use: (1) LIKE in the where clause or any other type of special comparison operators (2) citext for the column datatype or any other special

Databases - Why case insensitive?

时光总嘲笑我的痴心妄想 提交于 2019-12-07 04:48:20
问题 I saw one or two threads talking globally about case sensitivity, but my question is more specific. I understand the interest of case insensitive searches on text values for example. But why would we use case-insensitive database names, tables and columns? Isn't it going to lead to mistakes? Script languages that use databases are all case-sensitive, so for example if we didn't use the right case for a field it will not be found... 回答1: The SQL:2008 and SQL-99 standards define databases to be

Search array inArray but ignore case

旧时模样 提交于 2019-12-06 14:09:57
Hope I provided a clear title. I am creating an array comprised of all options, trimming whitespace, and storing. (correct me if im wrong in my process). On input change, if option array returns false, clear the next field, else, store the unique new value and place in next field. If array contains: blue black brown and I search for BLUE or Blue or BLue...etc, the result returns false. I guess im asking for caseInsensitive logic, but not sure how I can incorporate. Ive done this all on trial and error so please feel free to refine if your time allots. Also, this needs to be within spec of

JAX-RS: case-insensitive paths

馋奶兔 提交于 2019-12-06 10:00:58
I have anchored REST services/methods to URI template by @Path annotation. It looks like as usual: @GET @Path("/message") @Produces("application/json") public Response getMessage() { ... } But my REST service has to be case-insensitive. Now I'm using regular expression in @Path in all my code like that: @GET @Path("/{message:[mM][eE][sS][aA][gG][eE]}") @Produces("application/json") public Response getMessage() { ... } This looks weird. Is there something I overlooked in specification (I hope not, see this ) or has any of JAX-RS implementations special feature for that? Now I'm using JBoss

Make Folders in Apache Case Insensitive using .htaccess

会有一股神秘感。 提交于 2019-12-06 07:52:44
问题 I need to make accessing directories on my server case insensitive. How do I do that using htaccess? 回答1: You have to install and enable the mod_speling module in apache and set the CheckCaseOnly Directive to On in your .htaccess CheckCaseOnly On 回答2: If you want requested URLs to be valid whether uppercase or lowercase letters are used, use mod_speling to make URLs case-insensitive. Write the following code in .htaccess file: CheckSpelling On 回答3: This is what I used because my hosting is

git status reports modified files in a freshly cloned repo

谁都会走 提交于 2019-12-06 06:33:06
问题 Solved It seems the remote repo contains two files named the same, except for the first letter. This caused a file overwrite on my system, which led to the issue below. Update It seems it has nothing to do with newlines, but I can't yet find an explanation. Here's what happens. git status reports FileStartingWithCapitalLetter.php has been modified On the other hand, browsing my case-insensitive file system, shows fileStartingWithCapitalLetter.php, which is actually starting with a lower-case

Case insensitive filter query with Objectify + google appengine

杀马特。学长 韩版系。学妹 提交于 2019-12-06 04:16:21
问题 Is there an easy way to do a case insensitive filter query with Objectify + google appengine (Java)? Essentially this is what I am trying to do except that I need the filter on email to be case insensitive. Objectify objectifyService = ObjectifyService.begin(); objectifyService.query(AppUser.class).filter("email", email).get(); 回答1: You need to store your email address in a normalized (lowercase or uppercase, for instance) form in the datastore, and query on that. If you also need the