cdms2.axis:AbstractAxis

AbstractAxis.searchone(pattern, attname)

Search if the attribute with name attname is a string attribute which contains the compiled regular expression pattern, or if attname is None and pattern matches at least one string attribute.

Parameters
pattern:

(str) pattern

attname:

(str/None) attribute name

Returns
result: (int/True/False)
  • 1 or True if the attribute with name attname is a string attribute which contains the compiled regular expression pattern, or if attname is None and pattern matches at least one string attribute,

  • 0 or False if the attribute is not found or is not a string