case-insensitive

Is it possible for lxml to work in a case-insensitive manner?

不打扰是莪最后的温柔 提交于 2019-11-27 06:03:52
问题 I'm trying to scrape META keywords and description tags from arbitrary websites. I obviusly have no control over said website, so have to take what I'm given. They have a variety of casings for the tag and attributes, which means I need to work case-insensitively. I can't believe that the lxml authors are as stubborn as to insist on full forced standards-compliance when it excludes much of the use of their library. I'd like to be able to say doc.cssselect('meta[name=description]') (or some

Why is Common Lisp case insensitive?

喜你入骨 提交于 2019-11-27 05:49:43
问题 Is there an advantage to defining a function like (defun hi () "Hi!") and be able to call it by using (hi) or (HI) or (Hi) , or to (setf a-number 5) and be able to access that number using a-number , A-NUMBER , or A-Number ? If there is such an advantage, then why are most other languages case-sensitive? 回答1: Using case sensitive names in code within an interactive session is just more error-prone. Common Lisp is case sensitive. It is just that the Common Lisp reader functionality by default

c# Dictionary: making the Key case-insensitive through declarations

亡梦爱人 提交于 2019-11-27 05:48:19
问题 I have a Dictionary<string, object> dictionary. It used to be Dictionary<Guid, object> but other 'identifiers' have come into play and the Keys are now handled as strings. The issue is that the Guid keys from my source data are coming as VarChar , so now a key of "923D81A0-7B71-438d-8160-A524EA7EFA5E" is not the same as "923d81a0-7b71-438d-8160-a524ea7efa5e" (wasn't a problem when using Guids). What's really nice (and sweet) about the .NET framework is that I can do this: Dictionary<string,

Case insensitive JSON to POJO mapping without changing the POJO

时光怂恿深爱的人放手 提交于 2019-11-27 04:57:56
Does anyone know how com.fasterxml.jackson.databind.ObjectMapper is able to map JSON properties to POJO properties case insensitive? JSON-String: [{"FIRSTNAME":"John","LASTNAME":"Doe","DATEOFBIRTH":"1980-07-16T18:25:00.000Z"}] POJO-Class: public class Person { private String firstName; private String lastName; private Date dateOfBirth; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public Date

PHP-REGEX: accented letters matches non-accented ones, and vice versa. How to achieve this?

Deadly 提交于 2019-11-27 04:47:46
问题 I want to do typical highlight code. So I have something like: $valor = preg_replace("/(".$_REQUEST['txt_search'].")/iu", "<span style='background-color:yellow; font-weight:bold;'>\\1</span>", $valor); Now, the request word could be something like "josé". And with it, I want "jose" or "JOSÉ" or "José" etc highlighted too. With this expression, if I write "josé", it matches "josé" and "JOSÉ" (and all the case variants). It always matches the accented variants only. If I search "jose", it

How to change MySQL table names in Linux server to be case insensitive?

时光怂恿深爱的人放手 提交于 2019-11-27 04:39:09
I'm working on an old website that used to be hosted on an Apple server. When it was migrated into a new Linux server it stopped working. I'm pretty sure it's because all the MySQL queries used in the php scripts have different case combinations for the table names (I don't know why the original developers didn't follow any conventions when they created the table names or the php scripts) and it didn't matter because both Mac and Windows MySQL servers are case insensitive by default when it comes to this. However, Linux is not. Is there a way to change the Linux default on MySQL so it becomes

Case insensitive string comparison

空扰寡人 提交于 2019-11-27 04:24:11
问题 I would like to compare two variables to see if they are the same, but I want this comparison to be case-insensitive. For example, this would be case sensitive: if($var1 == $var2){ ... } But I want this to be case insensitive, how would I approach this? 回答1: This is fairly simple; you just need to call strtolower() on both variables. If you need to deal with Unicode or international character sets, you can use mb_strtolower(). Please note that other answers suggest using strcasecmp()—that

Is VB really case insensitive?

女生的网名这么多〃 提交于 2019-11-27 04:08:36
I'm not trying to start an argument here, but for whatever reason, it's typically stated that Visual Basic is case insensitive and C languages aren't (and somehow that is a good thing). But here's my question: Where exactly is Visual Basic case insensitive? When I type... Dim ss As String Dim SS As String ...into the Visual Studio 2008 or Visual Studio 2010 IDE, the second one has a warning of " Local variable SS is already declared in the current block ". In the VBA VBE, it doesn't immediately kick an error, but rather just auto-corrects the case. Am I missing something here with this

Case-insensitive search & replace with sed

℡╲_俬逩灬. 提交于 2019-11-27 04:01:47
I'm trying to use SED to extract text from a log file. I can do a search-and-replace without too much trouble: sed 's/foo/bar/' mylog.txt However, I want to make the search case-insensitive. From what I've googled, it looks like appending i to the end of the command should work: sed 's/foo/bar/i' mylog.txt However, this gives me an error message: sed: 1: "s/foo/bar/i": bad flag in substitute command: 'i' What's going wrong here, and how do I fix it? I'm on macOS, in case it matters. To be clear: On macOS - as of Mojave (10.14) - sed - which is the BSD implementation - does NOT support case

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

杀马特。学长 韩版系。学妹 提交于 2019-11-27 01:55:33
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 just a limitation of glob() ? Glob patterns support character ranges: glob('my/dir/*.[cC][sS][vV]') You could do this $files = glob('my/dir/*'); $csvFiles = preg_grep('/\.csv$/i', $files); glob('my/dir/*.[cC][sS][vV]') should do it. Yeah it's kind of ugly. You can also filter out the files after selecting all of them foreach(glob('my/dir/*') as $file)