var array = [ "aa", "cf", "vat" ]; alert( array.filter( search, /a/ ) ); function search(string){ return this.test( string ); };