Highlight elements that match a regex

http://stackoverflow.com/questions/18728103/how-can-i-highlight-elements-that-match-a-regex-in-ckeditor

HTML

<script src="http://cdn.jsdelivr.net/ckeditor/4.0/ckeditor.js"></script>
<input id="search" type="text" placeholder="Recherche DCI" ng-model="search_query" autofocus>
<tr ng-repeat="dci in dcis | filter:search_query">
            <td class='marque'>{{dci.marque}} ®</td>
            <td class="dci">{{dci.dci}}</td>
 </tr>
<span ng-bind-html="highlight(textToSearchThrough, searchText)"></span>

CSS

.highlightedText {
    background: yellow;
}

JavaScript

$scope.highlight = function(text, search) {
    if (!search) {
        return $sce.trustAsHtml(text);
    }
    return $sce.trustAsHtml(text.replace(new RegExp(search, 'gi'), '<span class="highlightedText">$&</span>'));
};