case-insensitive

Part of String Case Insensitive in JavaScript Regex (?i) option not working

笑着哭i 提交于 2019-12-02 04:01:55
问题 Oki before you all admins start marking this question duplicate referencing this SO question How to make regex case-insensitive? I want to clarify that the other referenced question doesn't answer my problem. I am using Nodejs to build application in which I need to process certain strings I have used the JS "RegExp" object for this purpose. I want only a part of my string in the regex to be case insensitive here's my code var key = '(?i)c(?-i)ustomParam'; var find = '\{(\\b' + key +'\\b:?.*?

c# file path string comparison case insensitivity

本小妞迷上赌 提交于 2019-12-01 18:37:04
I would like to compare two strings containing file paths in c#. However, since in ntfs the default is to use case insensitive paths, I would like the string comparison to be case insensitive in the same way. However I can't seem to find any information on how ntfs actually implements its case insensitivity. What I would like to know is how to perform a case insensitive comparison of strings using the same casing rules that ntfs uses for file paths. From MSDN : The string behavior of the file system, registry keys and values, and environment variables is best represented by StringComparison

MongoDB case insensitive key search

北城以北 提交于 2019-12-01 17:40:14
I am able to query values without regard to case, but I would like to to query keys insensitively, so users can type them in all lower case. This doesn't work, because it is not valid JSON: { /^lastName$/i: "Jones" } Is there a strategy I could use for this, besides just making a new collection of keys as values? There is currently no way to do this. MongoDB is "schema-free" but that should not be confused with "doesn't have a schema" . There's an implicit assumption that your code has some control over the names of the keys that actually appear in the system. Let's flip the question around.

JS - jQuery inarray ignoreCase() and contains()

帅比萌擦擦* 提交于 2019-12-01 16:56:35
well, I am more of a PHP person, and my JS skills are close to none when it comes to any JS other than simple design related operations , so excuse me if I am asking the obvious . the following operations would be a breeze in PHP (and might also be in JS - but I am fighting with unfamiliar syntax here ...) It is some sort of input validation var ar = ["BRS201103-0783-CT-S", "MAGIC WORD", "magic", "Words", "Magic-Word"]; jQuery(document).ready(function() { jQuery("form#searchreport").submit(function() { if (jQuery.inArray(jQuery("input:first").val(), ar) != -1){ jQuery("#contentresults").delay

MongoDB case insensitive key search

牧云@^-^@ 提交于 2019-12-01 16:23:59
问题 I am able to query values without regard to case, but I would like to to query keys insensitively, so users can type them in all lower case. This doesn't work, because it is not valid JSON: { /^lastName$/i: "Jones" } Is there a strategy I could use for this, besides just making a new collection of keys as values? 回答1: There is currently no way to do this. MongoDB is "schema-free" but that should not be confused with "doesn't have a schema" . There's an implicit assumption that your code has

PHP case-insensitive explode()

自闭症网瘾萝莉.ら 提交于 2019-12-01 16:09:43
I have the following code: explode("delimiter", $snippet); But I want that my delimiter is case-insensitive. Michael Robinson Just use preg_split() and pass the flag i for case-insensitivity: $keywords = preg_split("/your delimiter/i", $text); Also make sure your delimiter which you pass to preg_split() doesn't cotain any sepcial regex characters. Otherwise make sure you escape them properly or use preg_quote() . explode('delimiter',strtolower($snippet)); Never use expensive regular expressions when more CPU affordable functions are available. Never use double-quotes unless you explicitly have

Rails Routes - How to make them case insensitive?

安稳与你 提交于 2019-12-01 15:40:51
Routes in Ruby on Rails are case sensitive. It seems someone brought this up before, and it has been labeled will not fix. http://rails.lighthouseapp.com/projects/8994/tickets/393-routes-are-case-sensitive That strikes me as unfortunate, as I don't really see any upside on my own application for routes to be case sensitive, while on the downside it creates a potential for confusion and a general appearance of lack of polish in my opinion. What's the best way to make my routes case insensitive? I found this tip on a Google search: map.connect "web_feeds/:action", :controller => 'web_feeds',

PHP case-insensitive explode()

拥有回忆 提交于 2019-12-01 14:18:33
问题 I have the following code: explode("delimiter", $snippet); But I want that my delimiter is case-insensitive. 回答1: Just use preg_split() and pass the flag i for case-insensitivity: $keywords = preg_split("/your delimiter/i", $text); Also make sure your delimiter which you pass to preg_split() doesn't cotain any sepcial regex characters. Otherwise make sure you escape them properly or use preg_quote(). 回答2: explode('delimiter',strtolower($snippet)); Never use expensive regular expressions when

PostgreSQL + Rails citext

橙三吉。 提交于 2019-12-01 11:16:43
I am trying to move to heroku which uses PostgreSQL 8.4 which has a citext column type which is nice since the app was written for MySQL. Is there any way to use :citext with rails (so that if the migrations are run on MySQL the citext would just use string/text? I found this ticket, but it seems like it isn't going to be a part of rails for a while: https://rails.lighthouseapp.com/projects/8994/tickets/3174-add-support-for-postgresql-citext-column-type Tyler Rick Rails 4.2+ Rails 4.2 has native support for the citext column type. Rails < 4.2 If you're using Rails < 4.2, you can try using the

PostgreSQL + Rails citext

丶灬走出姿态 提交于 2019-12-01 09:00:30
问题 I am trying to move to heroku which uses PostgreSQL 8.4 which has a citext column type which is nice since the app was written for MySQL. Is there any way to use :citext with rails (so that if the migrations are run on MySQL the citext would just use string/text? I found this ticket, but it seems like it isn't going to be a part of rails for a while: https://rails.lighthouseapp.com/projects/8994/tickets/3174-add-support-for-postgresql-citext-column-type 回答1: Rails 4.2+ Rails 4.2 has native