case-insensitive

mod_rewrite RewriteCond - is NC flag necessary for just domain part? And some more

南楼画角 提交于 2019-11-30 01:23:05
I have seen many times in htaccess these type of rules : RewriteCond %{HTTP_REFERER} !^http://www.domain.it$ [NC] or RewriteCond %{HTTP_HOST} !^www\.domain\.it$ [NC] Why is the NC flag necessary, when checking only the domain part? I noticed browsers always converts uppercases in domain names into lower cases , so I don't see what the [NC] flag is usueful for in this case. I mean if we check the remaining part of the url I understand the need for [NC] flag cause on Unix systems www.domain.com/index.html is different file than www.domain.com/INDEX.HTML but I don't understand the need of NC flag

SQL- Ignore case while searching for a string

时光毁灭记忆、已成空白 提交于 2019-11-29 20:13:12
I have the following data in a Table PriceOrderShipped PriceOrderShippedInbound PriceOrderShippedOutbound In SQL I need to write a query which searches for a string in a table. While searching for a string it should ignore case. For the below mentioned SQL query SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%PriceOrder%' gives all the above data, whereas SELECT DISTINCT COL_NAME FROM myTable WHERE COL_NAME LIKE '%Priceorder%' doesn't give. Eg. when I search for 'PriceOrder' or 'priceOrder' it works but 'priceorder' or 'Priceorder' doesn't work. I have tried with the below query

How to do case insensitive search in Vim

对着背影说爱祢 提交于 2019-11-29 18:30:45
I'd like to search for an upper case word, for example COPYRIGHT in a file. I tried performing a search like: /copyright/i # Doesn't work but it doesn't work. I know that in Perl, if I give the i flag into a regex it will turn the regex into a case-insensitive regex. It seems that Vim has its own way to indicate a case-insensitive regex. Chinmay Kanchi You need to use the \c escape sequence. So: /\ccopyright To do the inverse (case sensitive matching), use \C instead. As well as the suggestions for \c and ignorecase , I find the smartcase very useful. If you search for something containing

Case insensitive find word an wrap it in a span

北城余情 提交于 2019-11-29 17:42:47
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).html(newItemHTML); }); Here is the entire thing put together: http://jsfiddle.net/97hxbyy0/ The script

Looking for case insensitive MySQL collation where “a” != “ä”

天大地大妈咪最大 提交于 2019-11-29 15:14:49
I'm looking for a MySQL collation for UTF8 which is case insensitive and distinguishes between "a" and "ä" (or more generally, between umlauted / accented characters and their "pure" form). utf8_general_ci does the former, utf8_bin the latter, bot none does both. If there is no such collation, what can I do to get as close as possible in a WHERE clause? My recommendation would be to use utf8_bin and in your WHERE clause, force both sides of your comparison to upper or lower case. It works fine here with utf8_german2_ci as collation: SELECT * FROM tablename WHERE fieldname LIKE "würz%" COLLATE

How to make string check case insensitive?

左心房为你撑大大i 提交于 2019-11-29 12:00:54
问题 I've started learning Python recently and as a practise I'm working on a text-based adventure game. Right now the code is really ineffective as it checks the user responce to see if it is the same as several variations on the same word. How do I change it so the string check is case insensitive? Example code below: if str('power' and 'POWER' and 'Power') in str(choice): print('That can certainly be found here.') time.sleep(2) print('If you know where to look... \n') 回答1: if 'power' in choice

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

妖精的绣舞 提交于 2019-11-29 11:34:48
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 matches "JOSE", "jose", "Jose" but not the accented ones. So I've partially what I want, cause I have case

Using sed to delete a case insensitive matched line

三世轮回 提交于 2019-11-29 10:41:30
问题 How do I match a case insensitive regex and delete it at the same time I read that to get case insensitive matches, use the flag "i" sed -e "/pattern/replace/i" filepath and to delete use d sed -e "/pattern/d" filepath I've also read that I could combine multiple flags like 2iw I'd like to know if sed could combine both i and d I've tried the following but it didn't work sed -e "/pattern/replace/id" filepath > newfilepath 回答1: For case-insensitive use /I instead of /i . sed -e "/pattern/Id"

Case sensitive and insensitive in the same pattern

百般思念 提交于 2019-11-29 10:06:16
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> , <LOLOLOlol> , because it's 3 uppercase letters, with repeatable last two letters in mixed case. I

ORACLE 11g case insensitive by default

被刻印的时光 ゝ 提交于 2019-11-29 07:26:49
I found in this article , that since ORACLE 10g, there is a way to make a particular connection-session compare strings case-insensitive, without needing any crazy SQL functions, using an ALTER SESSION . Does anyone know if, in 11g, there might be a way to make the database to always operate in this mode by default for all new connection-sessions, thereby eliminating the need for running ALTER SESSION s every time you connect? Or perhaps, an additional parameter you could specify on your connection string that would turn the same on? You could just set the NLS_SORT , NLS_COMP parameters