function _findAllMatchingSelectorsInText(text, selector) {
        var allSelectors = extractAllSelectors(text);
        var result = [];
        var i;
        
        // For sprint 4 we only match the rightmost simple selector, and ignore 
        // attribute selectors and pseudo selectors
        var classOrIdSelector = selector[0] === "." || selector[0] === "#";
        var prefix = "";
        
        // Escape initial "." in selector, if present.
        if (selector[0] === ".") {
            selector = "\\" + selector;
        }
        
        if (!classOrIdSelector) {
            // Tag selectors must have nothing or whitespace before it.
            selector = "(^|\\s)" + selector;
        }
        
        var re = new RegExp(selector + "(\\[[^\\]]*\\]|:{1,2}[\\w-()]+|\\.[\\w-]+|#[\\w-]+)*\\s*$", classOrIdSelector ? "" : "i");
        allSelectors.forEach(function (entry) {
            if (entry.selector.search(re) !== -1) {
                result.push(entry);
            } else if (!classOrIdSelector) {
                // Special case for tag selectors - match "*" as the rightmost character
                if (entry.selector.trim().search(/\*$/) !== -1) {
                    result.push(entry);
                }
            }
        });
        
        return result;
    }
Finds all instances of the specified selector in "text".
Returns an Array of Objects with start and end properties.

For Sprint 4, we only support simple selectors. This function will need to change
dramatically to support full selectors.

FUTURE: (JRB) It would be nice to eventually use the browser/jquery to do the selector evaluation.
One way to do this would be to take the user's HTML, add a special attribute to every tag with a UID,
and then construct a DOM (using the commented out code above). Then, give this DOM and the selector to 
jquery and ask what matches. If the node that the user's cursor is in comes back from jquery, then 
we know the selector applies.

@param text {!String} CSS text to search
@param selector {!String} selector to search for
@return {Array.<{selectorGroupStartLine:number, declListEndLine:number, selector:string}>}
     Array of objects containing the start and end line numbers (0-based, inclusive range) for each
     matched selector.