case-insensitive

Case-insensitive Lua pattern-matching

徘徊边缘 提交于 2019-12-18 19:35:02
问题 I'm writing a grep utility in Lua for our mobile devices running Windows CE 6/7, but I've run into some issues implementing case-insensitive match patterns. The obvious solution of converting everything to uppercase (or lower) does not work so simply due to the character classes. The only other thing I can think of is converting the literals in the pattern itself to uppercase. Here's what I have so far: function toUpperPattern(instr) -- Check first character if string.find(instr, "^%l") then

Case-insensitive Lua pattern-matching

此生再无相见时 提交于 2019-12-18 19:34:14
问题 I'm writing a grep utility in Lua for our mobile devices running Windows CE 6/7, but I've run into some issues implementing case-insensitive match patterns. The obvious solution of converting everything to uppercase (or lower) does not work so simply due to the character classes. The only other thing I can think of is converting the literals in the pattern itself to uppercase. Here's what I have so far: function toUpperPattern(instr) -- Check first character if string.find(instr, "^%l") then

.NET How to compare two Strings that represent filenames ignoring case correctly

房东的猫 提交于 2019-12-18 18:49:52
问题 Given that (at least on NTFS) the filesystem on Windows is case insensitive, I would like to compare String fileA to String fileB as such: fileA.Equals(fileB, StringComparison.CurrentCultureIgnoreCase) The question then becomes which culture I should use, does the default current (ui?) culture suffice? I can't seem to find any BCL methods for this purpose. 回答1: You should use StringComparison.OrdinalIgnoreCase , according to Best Practices for Using Strings in the .NET Framework. The string

Case insensitive string search in golang

白昼怎懂夜的黑 提交于 2019-12-18 11:18:33
问题 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. 回答1: strings.EqualFold() can check if two strings are equal, while ignoring case. It even works with Unicode. See http://golang.org/pkg/strings/#EqualFold for more info. http://play.golang.org/p/KDdIi8c3Ar package main import ( "fmt" "strings" ) func main() { fmt.Println(strings.EqualFold(

Git: File Rename

≯℡__Kan透↙ 提交于 2019-12-18 10:03:37
问题 I wanted to rename a folder from " Frameworks " to " frameworks ", but git would not let me add the new lowercase name. I guess it treats filenames case insensitive, does it? A git add frameworks/ -f didn't help 回答1: You can try: "git mv -f foo.txt Foo.txt" (note: this is no longer needed since git 2.0.1) to set ignorecase to false in the config file. But the issue of case (on Windows for instance) is described in the msysgit issue 228 (again: this should now -- June 2014 -- work with git 2.0

Case insensitive find word an wrap it in a span

六眼飞鱼酱① 提交于 2019-12-18 09:45:45
问题 I have made a small script designed to find a string and wrap it in a span. The string is stored in a variable. The HTML <h2>I have a lot of friends.</h2> <h2>My best friend's name is Mike.</h2> <h2>My best friend's website is <a href="http://www.myfriendmike.com">myfriendmike.com</a>.</h2> The jQuery var term = "friend"; var item = $("h2"); $(item).each(function() { var itemHTML = $(this).html(); var newItemHTML = itemHTML.replace(term, '<span class="highlight">' + term + '</span>'); $(this)

Case sensitive and insensitive in the same pattern

北战南征 提交于 2019-12-18 05:54:15
问题 Thanks to the help with my previous homework question Regex to match tags like <A>, <BB>, <CCC> but not <ABC>, but now I have another homework question. I need to match tags like <LOL> , <LOLOLOL> (3 uppercase letters, with repeatable last two letters), but not <lol> (need to be uppercase). Using the technique from the previous homework, I tried <[A-Z]([A-Z][A-Z])\1*> . This works, except there's an additional catch: the repeating part can be in mixed case! So I need to also match <LOLolol> ,

case insensitive LDAP searches

北城以北 提交于 2019-12-17 20:09:45
问题 What't the syntax for performing a case-insensitive match on a 'uid' attribute? If attribute definition matters then how would that be changed? In particular I am using ApacheDS for my LDAP store. 回答1: (uid=miXedCaseUSer) will match a uid of mixedcaseuser. Accoriding to the OID Description for 0.9.2342.19200300.100.1.1 - Userid userId is defined to have EQUALITY MATCHING RULE caseIgnoreMatch Which means it is one of the attribute definitions that employ case insensitive matching by default.

How to change the collation of sqlite3 database to sort case insensitively?

孤者浪人 提交于 2019-12-17 19:32:54
问题 I have a query for sqlite3 database which provides the sorted data. The data are sorted on the basis of a column which is a varchar column "Name". Now when I do the query select * from tableNames Order by Name; It provides the data like this. Pen Stapler pencil Means it is considering the case sensitive stuff. The way I want is as follows Pen pencil Stapler So what changes should I make in sqlite3 database for the necessary results? Related How to set Sqlite3 to be case insensitive when

Git fetch a branch once with a normal name, and once with capital letter

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 16:41:41
问题 I'm fetching for remote branches and stuck in some sort of a loop. I fetch once and get: $ git fetch * [new branch] minorRelease/something-> origin/minorRelease/something And then I fetch again and get: $ git fetch * [new branch] minorRelease/Something-> origin/minorRelease/Something Same branch but with a capital S . I tried to delete the file from the following folder .git/refs/remotes/origin/minorRelease , but when fetching again, I get both and return to the loop above: $ git fetch * [new