Q:

Looping array from input and getting all matches

I'm trying to loop through an array of items and see if any of those match then show them. Well if I type in any character they all show.
(sensitive == false ? RegExp('^'+this.value,'i').test(source[i]) : RegExp('^'+this.value).test(source[i]) )

this is my condition, though if the this.value = a every single item in the array (source[i]) shows up. Is there a way to make this more strict?
EXAMPLE
if array is (using jquery autocomplete example array)
var availableTags = [
    "ActionScript",
    "AppleScript",
    "Asp",
    "BASIC",
    "C",
    "C++",
    "Clojure",
    "COBOL",
    "ColdFusion",
    "Erlang",
    "Fortran",
    "Groovy",
    "Haskell",
    "Java",
    "JavaScript",
    "Lisp",
    "Perl",
    "PHP",
    "Python",
    "Ruby",
    "Scala",
    "Scheme"
];

element.addEventListener('keypress', function (e) {
    var dd = document.getElementById('fake_dropdown');
    for (i = 0; i < availableTags.length; i++) {
        var li;
        if ((sensitive == false ? RegExp('^' + this.value, 'i').test(availableTags[i]) : RegExp('^' + this.value).test(availableTags[i]))) {
            li = document.getElementById('auto_id_' + (i + 1));
            li.style.display = "block";
        } else {
            li = document.getElementById('auto_id_' + (i + 1));
            li.style.display = "none";
        }
        var liLoop = dd.getElementsByTagName('li');
        for (var j = 0; j < liLoop.length; j++) {
            if (liLoop[j].style.display == "block") break;
            else dd.style.display = "none";
        }
    }
}, false);

UPDATED MORE CODE 
All these show up. Why is this? Also why is BACKSPACE not considered to be a keypress, for it doesn't reevaluate the condition if I click backspace.

A:

See
el.addEventListener('focus', function (e) {
    lastIndex = this;
    if (typeof focus == 'function') focus.call(this, this);
}, false);
//use keyup handler since keypress will not be fired for unprintable characters
//don't register the handler inside the focus handler since it can cause multiple event registrations
el.addEventListener('keyup', function (e) {
    var dd = document.getElementById('fake_dropdown'),
        items = 0;
    var top, left, height, width, bottom;

    var term = this.value,
        //move this out out the for loop
        regex = (sensitive == false ? new RegExp('^' + this.value, 'i') : new RegExp('^' + this.value));

    for (i = 0; i < source.length; i++) {
        var li = document.getElementById('auto_id_' + (i + 1));
        if (regex.test(availableTags[i])) {
            li.style.display = "block";
            items++;
        } else {
            li.style.display = "none";
        }
    }
    if (items == 0) {
        dd.style.display = "none";
    } else {
        top = el.offsetTop
        left = el.offsetLeft;
        height = el.offsetHeight;
        width = el.offsetWidth;
        bottom = top + height;
        dd.style.left = left + 'px';
        dd.style.top = bottom + 'px';
        dd.style.width = width + 'px';
        dd.style.display = "block";
    }
}, false);

Demo: Fiddle

