Javascript: highlight substring keeping original case but searching in case insensitive mode

Use a function for the second argument for .replace() that returns the actual matched string with the concatenated tags. Try it out: http://jsfiddle.net/4sGLL/ reg = new RegExp(querystr, ‘gi’); // The str parameter references the matched string // ————————————–v final_str=”foo ” + result.replace(reg, function(str) {return ‘<b>’+str+'</b>’}); $(‘#’ + id).html(final_str);​ JSFiddle Example with Input: https://jsfiddle.net/pawmbude/

How do you change the capitalization of filenames in Git?

Starting Git 2.0.1 (June 25th, 2014), a git mv will just work on a case-insensitive OS. See commit baa37bf by David Turner (dturner-tw). mv: allow renaming to fix case on case-insensitive filesystems “git mv hello.txt Hello.txt” on a case-insensitive filesystem always triggers “destination already exists” error, because these two names refer to the same path … Read more

Can I use camelCase in CSS class names

Technically yes, but it’s risky because while CSS syntax is mostly case-insensitive, in some browsers under certain conditions, class names are treated as case-sensitive, as the spec does not specify how browsers should handle case when matching CSS rules to HTML class names. From the spec, section 4.1.3: All CSS syntax is case-insensitive within the … Read more

tech