Regex Filters (autotransform.filter.regex)

The implementation for regex based filters, including RegexFilter and FileContentRegexFilter.

class autotransform.filter.regex.RegexFileContentFilter(*, inverted: bool = False, pattern: str)

Bases: Filter

A Filter which only passes FileItems where the file’s content contains a match to the provided regex pattern. Uses re.search rather than re.match.

pattern

The pattern to use when checking the FileItem’s content

Type:

str

name

The name of the component.

Type:

ClassVar[FilterName]

name: ClassVar[FilterName] = 'regex_file_content'
pattern: str
class autotransform.filter.regex.RegexFilter(*, inverted: bool = False, pattern: str)

Bases: Filter

A Filter which only passes Items where the Item’s key matches a provided regex pattern. Uses re.search rather than re.match.

pattern

The pattern to use when checking the Item’s key.

Type:

str

name

The name of the component.

Type:

ClassVar[FilterName]

name: ClassVar[FilterName] = 'regex'
pattern: str