[List,SubD] = dbsearchuserdata(D,Field1,Regexp1,Field2,Regexp2,...)
[List,SubD] = dbsearchuserdata(D,Flag,Field1,Regexp1,Field2,Regexp2,...)
D
[ struct ] - Input database whose tseries fields will be searched.
Flag
[ '-all'
| '-any'
] - Specifies if all conditions or any condition must be met for the series to pass the test; if not specified, '-all'
is assumed.
Field1
, Field2
, ... [ char ] - Names of fields in the userdata struct.
Regexp1
, Regexp2
, ... [ char ] - Regular expressions against which the respective userdata fields will be matched.
List
[ cellstr ] - Names of tseries that pass the test.
Subd
[ struct ] - Sub-database with only those tseries that pass the test.
For a successful match, the userdata must be a struct, and the tested fields must be text strings.
Use an equal sign, =
, after the name of the userdata fields in Field1
, Field2
, etc. to request a case-insensitive match, and an equal-shart sign, =#
, to indiciate a case-sensitive match.
[list,dd] = dbsearchuserdata(d,'.DESC=','Exchange rate','.SOURCE=#','IMF');
Each individual tseries object in the database D
will be tested for two conditions:
whether its user data is a struct including a field named DESC
, and the field contains a string 'Exchange rate'
in it (case insensitive, e.g. 'eXcHaNgE rAtE'
will also be matched);
whether its user data is a struct including a field named SOURCE
, and the field contains a string 'IMF'
in it (case sensitive, e.g. 'Imf'
will not be matched).
All tseries object that pass both of these conditions are returned in the List
and the output database D
.