case-insensitive

ES6: Filter data with case insensetive term

一笑奈何 提交于 2019-12-10 13:15:02
问题 This is how I filter some data by title value: data.filter(x => x.title.includes(term)) So data like Sample one Sample Two Bla two will be 'reduced' to Bla two if I'm filtering by two . But I need to get the filtered result Sample Two Bla two 回答1: You can use a case-insensitive regular expression: // Note that this assumes that you are certain that `term` contains // no characters that are treated as special characters by a RegExp. data.filter(x => new RegExp(term, 'i').test(x.title)); A

How to deactivate uppercase check in cygwin folder autocompletion?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 12:56:49
问题 When navigating a file hierarchy under Cygwin, pressing tab after cd + a few characters will replace those few characters by the name of a directory whose name starts by the same characters, if such a directory is present in the current folder. However, the test seems to be case-sensitive. How to deactivate the case-sensitivity ? 回答1: Try: set completion-ignore-case On (This is for bash, which I'm pretty sure cygwin uses.) EDIT: This change will only take effect for the duration of your

Why can't I define a case-insensitve Dictionary in C#?

家住魔仙堡 提交于 2019-12-10 12:49:13
问题 This C#/WPF code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace TestDict28342343 { public partial class Window1 : Window { public Window1() { InitializeComponent(); Dictionary

JAX-RS: case-insensitive paths

…衆ロ難τιáo~ 提交于 2019-12-10 10:58:18
问题 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

Case insensitive Rspec match

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-09 07:48:18
问题 I'm writing a Capybara test and using Rspec for the assertions. My test is failing because there is a CSS style being applied that is causing the text to be in all caps. How can I rewrite this so that it is a case insensitive assertion? "ALL CAPS".should include('All Caps') 回答1: Here's improving on phoet's solution: page.body.should match(%r{#{string}}i) Unfortunately the syntax highlighting here isn't doing it much justice (it looks perfectly fine in Sublime Text) 回答2: I only run into this

Case-insensitive matching in Marpa

淺唱寂寞╮ 提交于 2019-12-08 20:29:07
问题 Related to my earlier question about case-insensitive keyword matching using regular expressions. Is it possible to match strings case-insensitively in Marpa? If so, how? Suppose I have the grammar :start ::= script identifier ~ [\w]+ script ::= 'script' identifier code code ::= command* command ::= 'run' | 'walk' | 'stop' How can I make it match any of script , Script , SCRIPT or any other combination of lower and uppercase letters? 回答1: There isn't a straightforward way to specify case

JQuery: How do I select a value from a dropdownlist case insensitive?

人走茶凉 提交于 2019-12-08 15:23:01
问题 My scenario: I have a textbox that the user enters text The textbox has an onblur function that tries to select a value from a dropdownlist (if it exists) based on the textbox input This works perfectly fine if the textbox value is the same case as the dropdownlist value. But I want it to be case insensitive. So if the user types "stackoverflow" then I want it to select from the dropdownlist "StackOverflow". How can I do this via jQuery? 回答1: Here's another approach: find the matching value

Elastic Search Case Insensitive query with prefix query

大城市里の小女人 提交于 2019-12-08 11:26:36
问题 I am new to elastic search. I have below query GET deals2/_search { "size": 200, "_source": ["acquireInfo"], "query": { "bool": { "must": [ { "query_string": { "fields": ["acquireInfo.company_name.keyword"], "query": "az*" } } ] } } } Here I want Elastic should gives results like case insensitive Like string start with below like "Az" "AZ" "az" "aZ" "Az" But I am not getting all results like this way. So Anyone can please help me on that. Example:- I have 4 documents 1)Aziia Avto Ust

How can I do case insensitive string search with Linq and SQL Server?

主宰稳场 提交于 2019-12-08 07:01:02
问题 Here is my current code for searching tags: public JsonResult TagSearch(string term) { if (term == null || term == "") return Json(""); var tags = (from t in _session.All<Tag>() where t.Name.Contains(term) select t.Name).Take(6).ToArray(); return Json(tags); } How could I do case insensitive string search instead? 回答1: The Contains() method is converted to case-insensitive operation in SQL. I think the code I posted is case insensitive. 回答2: Is changing the collation of the column out of the

Search array inArray but ignore case

浪尽此生 提交于 2019-12-08 02:45:39
问题 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