function index = searchListReg(thelist,pattern) %searchListReg - search for a name pattern in a list of objects using a % regular expression pattern % % Parameter: thelist The list to be searched % Parameter: pattern The name pattern to be searched for % Returns: index A list of indexes that matches % % Example(s): % vdslix = searchListReg(ex.tfplist,'^VDSL'); % Find all VDSL tfplans % %% =========================================================================== %% =========================================================================== % Copyright (C): % 2007-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % CVS: $Id: $ %% =========================================================================== % Change History % 2007-01-18 (ToNo) Created %% =========================================================================== len = length(thelist); index = []; for i=1:len, y=thelist{i}; if length(regexp(y.name, pattern))>0 index = [index i]; end; end