JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app='myApp' ng-controller="Main">
<li ng-repeat="user in users | regex:'type':'^c5$'">{{user.name}}</li>
</div>
JavaScript
var myApp = angular.module('myApp', []);
myApp.filter('regex', function() {
return function(input, field, regex) {
var patt = new RegExp(regex);
var out = [];
for (var i = 0; i < input.length; i++){
if(patt.test(input[i][field]))
out.push(input[i]);
}
return out;
};
});
function Main($scope){
$scope.users = [{name: 'first user', type: 'ac5x'},
{name: 'second user', type: 'c5'},
{name: 'third user', type: 'cc55'},
{name: 'fourth user', type: 'c5'}
];
}