watex.utils.funcutils.parse_attrs#

watex.utils.funcutils.parse_attrs(attr, /, regex=None)[source]#

Parse attributes using the regular expression.

Remove all string non-alphanumeric and some operator indicators, and fetch attributes names.

Parameters:
  • attr (str, text litteral containing the attributes) – names

  • regex (re object, default is) –

    Regular expresion object. the default is:

    >>> import re
    >>> re.compile (r'per|mod|times|add|sub|[_#&*@!_,;\s-]\s*',
                        flags=re.IGNORECASE)
    

Returns:

attr

Return type:

List of attributes

Example

>>> from watex.utils.funcutils import parse_attrs
>>> parse_attrs('lwi_sub_ohmSmulmagnitude')
... ['lwi', 'ohmS', 'magnitude']