':param type: Type of quality component. (resolution, source, codec, or audio)
:param value: Value used to sort this component with others of like type.
:param name: Canonical name for this quality component.
:param regexp: Regexps used to match this component.
:param modifier: An integer that affects sorting above all other components.
:param defaults: An iterable defining defaults for other quality components if this component matches.'

def __init__(self, type, value, name, regexp=None, modifier=None, defaults=None):

    if (type not in [u'resolution', u'source', u'codec', u'audio']):
        raise ValueError((u'%s    is    not    a    valid    quality    component    type.' % type))
    self.type = type
    self.value = value
    self.name = name
    self.modifier = modifier
    self.defaults = (defaults or [])
    if (regexp is None):
        regexp = re.escape(name)
    self.regexp = re.compile(((u'(?<![^\\W_])(' + regexp) + u')(?![^\\W_])'), re.IGNORECASE)
