PATTERNS#
- scikitplot.cleanprompt.PATTERNS = {'AWS_ACCESS_KEY': PatternSpec(kind='AWS_ACCESS_KEY', pattern='\\b(?:AKIA|ASIA|AGPA|AIDA|AROA|ANPA|ANVA|ABIA|ACCA)[0-9A-Z]{16}\\b', intent='An AWS access key identifier, recognised by its documented four-character resource-type prefix and sixteen-character body.', priority=95, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('AKIAIOSFODNN7EXAMPLE',), examples_no=('AKIA', 'NOTAKEYHERE1234567890'), risk_reason=None), 'CREDIT_CARD': PatternSpec(kind='CREDIT_CARD', pattern='\\b(?:[0-9]{4}[ -]?){3}[0-9]{1,7}\\b', intent='A payment card number in the common four-group layout. Luhn decides, so long order numbers and identifiers are not swept in.', priority=90, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('4242 4242 4242 4242', '4242-4242-4242-4242', '4111111111111111'), examples_no=('1234 5678 9012 3456', '0000 0000 0000 0001'), risk_reason=None), 'EMAIL': PatternSpec(kind='EMAIL', pattern="\\b[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?(?:\\.[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?)+", intent="An email address, following the RFC 5322 dot-atom local part and an RFC 1035 label-based domain. The top-level label is letters, digits or hyphen only; the upstream class '[A-Z|a-z]' admitted a literal pipe, which is defect CP-005.", priority=80, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('a.b+tag@example.co.uk', 'user_name@sub.domain.org', "o'hara.test@example.com"), examples_no=('a@b', 'not.an.email', '@example.com', 'a@-bad.com', 'a@b..c'), risk_reason=None), 'IBAN': PatternSpec(kind='IBAN', pattern='\\b[A-Z]{2}[0-9]{2}(?:[ ]?[A-Z0-9]{4}){2,7}(?:[ ]?[A-Z0-9]{1,3})?\\b', intent='An international bank account number. The structural shape alone is far too permissive, so the mod-97 checksum decides.', priority=90, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('GB82 WEST 1234 5698 7654 32', 'DE89370400440532013000'), examples_no=('GB00 WEST 1234 5698 7654 32', 'AB12 CDEF'), risk_reason=None), 'IPV4': PatternSpec(kind='IPV4', pattern='(?<!\\d\\.)(?<!\\w)(?:[0-9]{1,3}\\.){3}[0-9]{1,3}(?!\\.?\\d)(?!\\w)', intent="A dotted-quad IPv4 address. The octet range is checked by a validator rather than by an unreadable alternation. The guards reject a longer dotted run such as '1.2.3.4.5' without rejecting an address at the end of a sentence: the trailing dot only disqualifies the match when a digit follows it (CP-028).", priority=60, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('192.168.1.10', '8.8.8.8'), examples_no=('999.1.1.1', '1.2.3', '1.2.3.4.5'), risk_reason=None), 'IPV6': PatternSpec(kind='IPV6', pattern='(?<![:.\\w])(?:[0-9A-Fa-f]{1,4}:){2,7}[0-9A-Fa-f]{1,4}(?![:\\w])(?!\\.\\w)', intent='An IPv6 address in its common full or partially compressed forms. Placed above IPv4 so that an embedded dotted quad is not split. The trailing dot is rejected only when something follows it, so an address ending a sentence is still found (CP-028).', priority=65, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('2001:0db8:85a3:0000:0000:8a2e:0370:7334', 'fe80:1:2:3:4:5:6:7'), examples_no=('12:34', 'not:an:address:zz'), risk_reason=None), 'JWT': PatternSpec(kind='JWT', pattern='\\beyJ[A-Za-z0-9_-]{4,}\\.[A-Za-z0-9_-]{4,}\\.[A-Za-z0-9_-]{4,}\\b', intent='A JSON Web Token. Anchored on the base64 of \'{"\' so that an arbitrary three-part dotted identifier is not mistaken for one.', priority=95, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxIn0.dBjftJeZ4CVP',), examples_no=('a.b.c', 'one.two.three'), risk_reason=None), 'MAC': PatternSpec(kind='MAC', pattern='\\b(?:[0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}\\b', intent='A hardware (MAC) address in colon or hyphen notation. Ranked above IPV6 because the two shapes collide: six colon-separated pairs of hex digits is a valid IPv6 fragment and an exact MAC, and equal-length spans are arbitrated by priority.', priority=70, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('00:1B:44:11:3A:B7', '00-1b-44-11-3a-b7'), examples_no=('00:1B:44:11:3A', 'zz:zz:zz:zz:zz:zz'), risk_reason=None), 'PHONE': PatternSpec(kind='PHONE', pattern='(?<![\\w.])(?:\\+[0-9]{1,3}[ .\\-]?)?(?:\\([0-9]{2,4}\\)[ .\\-]?)?[0-9]{2,4}(?:[ .\\-][0-9]{2,4}){1,4}(?![\\w])', intent='A telephone number written with separators, or with an international prefix. A validator enforces a 7-to-15 digit count and rejects ISO-8601 dates, which the upstream expression matched (defect CP-013).', priority=40, flags=0, confidence=0.85, enabled_by_default=True, examples_yes=('+1 555 010 4477', '(020) 7946 0958', '555-010-4477'), examples_no=('2024-01-15', '12345678', '1.26.4', 'Revenue rose 1234'), risk_reason=None), 'PRIVATE_KEY': PatternSpec(kind='PRIVATE_KEY', pattern='-----BEGIN (?:[A-Z][A-Z ]{0,40})?PRIVATE KEY-----[\\s\\S]{0,8192}?-----END (?:[A-Z][A-Z ]{0,40})?PRIVATE KEY-----', intent='A PEM-armoured private key block. Highest priority because the body contains base64 that other patterns would otherwise carve up.', priority=100, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJB\n-----END RSA PRIVATE KEY-----',), examples_no=('-----BEGIN CERTIFICATE-----\nMIIB\n-----END CERTIFICATE-----',), risk_reason=None), 'SSN_US': PatternSpec(kind='SSN_US', pattern='\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b', intent='A United States Social Security number in its hyphenated form. Only the hyphenated shape is matched, because a bare nine-digit run is indistinguishable from countless other identifiers.', priority=85, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('123-45-6789',), examples_no=('000-45-6789', '666-45-6789', '123-00-6789', '123456789'), risk_reason=None), 'TITLE_CASE': PatternSpec(kind='TITLE_CASE', pattern="\\b[^\\W\\d_][^\\W\\d_'\\u2019.\\-]*(?:[ \\t]+[^\\W\\d_][^\\W\\d_'\\u2019.\\-]*){1,5}\\b", intent="A run of two or more capitalised words, which is what most personal and organisation names look like. DISABLED BY DEFAULT and deliberately so: it is the only pattern here whose precision is not high. It exists because without the optional 'ner' tier there is otherwise nothing at all that can find a person's name, and a redaction tool that silently cannot see names is worse than one that over-redacts visibly. Enable it explicitly, or use the suggestion surface instead, which shows candidates and lets a person choose.", priority=20, flags=0, confidence=0.45, enabled_by_default=False, examples_yes=('Mustafa Kemal Atatürk', 'Ada Lovelace', 'Acme Corporation'), examples_no=('The quick brown fox', 'he went to town', 'Turkey', 'however Ada left'), risk_reason=None), 'URL': PatternSpec(kind='URL', pattern="\\b(?:https?|ftp)://[A-Za-z0-9\\-._~%]*[A-Za-z0-9\\-_~%](?::[0-9]{1,5})?(?:/(?:[A-Za-z0-9\\-._~%!$&'()*+,;=:@/]*[A-Za-z0-9\\-_~%$&*+=:@/])?)?(?:\\?(?:[A-Za-z0-9\\-._~%!$&'()*+,;=:@/?]*[A-Za-z0-9\\-_~%$&*+=:@/])?)?(?:#(?:[A-Za-z0-9\\-._~%!$&'()*+,;=:@/?]*[A-Za-z0-9\\-_~%$&*+=:@/])?)?", intent="An absolute http, https or ftp URL, built from the RFC 3986 unreserved and sub-delimiter sets written out explicitly. The upstream class '[$-_@.&+]' was read by the engine as the range 0x24 to 0x5F, which is defect CP-004. A URL may not end on sentence punctuation, so a trailing full stop, comma or bracket is left in the text instead of being swallowed into the placeholder (CP-029).", priority=70, flags=0, confidence=1.0, enabled_by_default=True, examples_yes=('https://example.com/path?q=1#frag', 'http://10.0.0.1:8080/x', 'ftp://files.example.org/pub', 'https://example.com', 'https://example.com/a/b/'), examples_no=('example.com', 'mailto:a@b.co', '://nope'), risk_reason=None)}#
!! processed by numpydoc !!