case-sensitive

Convert first lowercase to uppercase and uppercase to lowercase (regex?)

狂风中的少年 提交于 2020-01-15 06:11:05
问题 I have a huge file in this layout: world12345:Betaalpha world12344:alphabeta world12343:ZetaBeta world12342:!betatheta I need to convert the first lowercase letter after the ":" to uppercase and the first uppercase letter to lowercase. I've tried using notepad++ and emeditor, but I'm not that experienced with regex. This is how I want it to become after (regex?) world12345:betaalpha world12344:Alphabeta world12343:zetaBeta world12342:!betatheta (unchanged, as the first char is a special char)

Case insensitive utf8 select

对着背影说爱祢 提交于 2020-01-11 05:44:08
问题 In SQLite I want to case-insensitive "SELECT LIKE name" works fine for normal latin names, but when the name is in UTF-8 with non-latin characters then the select becomes case-sensitive, how to make it also case-insensitive like latin characters? p.s. my sqlite is v3 and I connect with PHP PDO 回答1: For SQLite you have 2 options: compile it with ICU support: How to compile, Compilation options override the LIKE function, here is a complete solution (from http://blog.amartynov.ru/?p=675) $pdo =

Override case sensitive regex in Perl

99封情书 提交于 2020-01-11 05:07:33
问题 Is it possible to override the case sensitivity of a previously defined regex in Perl? For instance, if I were to have the following: my $upper = qr/BLAH/x; my $lower = qr/$upper/xi; warn "blah" =~ $lower I'd like the third line to print a positive match. 回答1: You can add the /i to the regexp as follows: use re qw( is_regexp regexp_pattern ); sub make_re_case_insensitive { my ($re) = @_; return "(?i:$re)" if !is_regexp($re); my ($pat, $mods) = regexp_pattern($re); if ($mods !~ /i/) { $re =

how to search for exact string in mysql

自古美人都是妖i 提交于 2020-01-09 09:24:12
问题 I'm trying to search for an exact match of a string in mysql. The string is 'nrew'. But when I do the queries below, I still get a result: SELECT UserID FROM sys_users WHERE UserID='NREW' SELECT UserID FROM sys_users WHERE UserID='NrEw' Please help. 回答1: SELECT UserID FROM sys_users WHERE BINARY UserID='NREW' 回答2: The default collation which MySQL uses to make comparisons is case insensitive. You need to specify a case sensitive collation or binary. You can either do this when creating the

pdo bindParam case sensitive

折月煮酒 提交于 2020-01-06 12:18:28
问题 I want to check if the password is correct (Case sensitive). Currently, I'm using PDO, something like this: $sql = 'select * from User WHERE Email = :user and Password = :pass AND idRole = :role AND idState_User = :state'; $stat = $this->_db->prepare($sql); $stat->bindParam(':user', $user, PDO::PARAM_STR); $stat->bindParam(':pass', $password, PDO::PARAM_STR); $stat->bindParam(':state', $idState_User, PDO::PARAM_INT); $stat->bindParam(':role', $idRole, PDO::PARAM_INT); $stat->execute(); I

pdo bindParam case sensitive

只愿长相守 提交于 2020-01-06 12:15:10
问题 I want to check if the password is correct (Case sensitive). Currently, I'm using PDO, something like this: $sql = 'select * from User WHERE Email = :user and Password = :pass AND idRole = :role AND idState_User = :state'; $stat = $this->_db->prepare($sql); $stat->bindParam(':user', $user, PDO::PARAM_STR); $stat->bindParam(':pass', $password, PDO::PARAM_STR); $stat->bindParam(':state', $idState_User, PDO::PARAM_INT); $stat->bindParam(':role', $idRole, PDO::PARAM_INT); $stat->execute(); I

How to extract upper case words within a long string using perl

余生长醉 提交于 2020-01-06 07:06:08
问题 I am trying to find a way to extract only upper case words (at least three consecutive upper characters, plus numbers) from quite a long string using perl. Example: "Hello world, thank GOD it's Friday, I can watch EPISODE4" Output: "GOD EPISODE4" For some reason I cannot come up with a sensible way to do this, any ideas? Thanks! 回答1: Use character classes: my @matches = ( $string =~ /\b[[:upper:]|[:digit:]]{3,}+\b/g ); say join " - ", @matches; (You stated uppercase characters and numbers.

Entity Framework Case Sensitive Query

橙三吉。 提交于 2020-01-05 03:49:10
问题 I have a table that named Post which has a column named key : Id | Key | Title -------------------- 1 | WM | First -------------------- 2 | wm | Second As you can see the first key value of a Post is WM (Uppercase) and the second key value is wm (lowercase). When I execute the query with following code: var post = await _posts.Where(o => o.Key == key).Select(o => new { id = o.Id, title = o.Title }).SingleOrDefaultAsync(); I pass the key with a value (wm and WM) but get one result. The second

Isn't Android File.exists() case sensitive?

纵然是瞬间 提交于 2020-01-03 07:22:45
问题 I've created a new folder "sdcard/ dd " by: File album = new File(albumPath); if (album.exists()) { Log.d(TAG, albumPath + " already exists."); } else { boolean bFile = album.mkdir(); } And Again, I create the second folder "sdcard/ DD " by the same code, but, this time the album.exists() returns true, which indicates the "dd" is equals "DD". Anyone know why the File.exists() can NOT check the case of the folder name? Thanks! 回答1: While Linux, and therefore also Android, normally is case

Apache Case insentive URLs

假如想象 提交于 2020-01-03 03:31:11
问题 Apache is not allowing me to access a link with a wrong case. This URL case sensitivity really sucks me. Can anyone help me out how to configure my apache so that however I call my URL it has to work. I am running my site on a shared linux server and not provided with SSH. I tried all the solutions in google but nothing worked for me. Anybody please help me. Please do not tell me to get into so and so option (as there are limited services provided in my cPanel, find them in the below