How to use the regex.get_defined_values_regex function in regex

To help you get started, we’ve selected a few regex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'TRL')),
                  CWRField('Group count', regex.get_numeric_regex(5)),
                  CWRField('Transaction count', regex.get_numeric_regex(8)),
                  CWRField('Record count', regex.get_numeric_regex(8))]

        super(TransmissionTrailerRecord, self).__init__(record, fields)
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'PWR')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('IP ID', regex.get_ascii_regex(9)),
                  CWRField('Name', regex.get_ascii_regex(45)),
                  CWRField('Agreement number', regex.get_ascii_regex(14, True)),
                  CWRField('Society assigned number', regex.get_ascii_regex(14, True)),
                  CWRField('Writer IP ID', regex.get_ascii_regex(9))]

        super(WriterAgentRecord, self).__init__(record, fields)
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'NPA')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Interested party ID', regex.get_ascii_regex(9)),
                  CWRField('Name', regex.get_non_roman_regex(160)),
                  CWRField('Writer first name', regex.get_non_roman_regex(160)),
                  CWRField('Language code', regex.get_alpha_regex(2, True))]

        super(NRAgreementPartyNameRecord, self).__init__(record, fields)
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'NWR', 'REV')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Title', regex.get_ascii_regex(60)),
                  CWRField('Language code', regex.get_alpha_regex(2, True)),
                  CWRField('Submitter ID', regex.get_ascii_regex(14)),
                  CWRField('ISWC', regex.get_ascii_regex(11, True)),
                  CWRField('Copyright date', regex.get_date_regex(True)),
                  CWRField('Copyright number', regex.get_ascii_regex(12, True)),
                  CWRField('Musical distribution category', regex.get_alpha_regex(3)),
                  CWRField('Duration', regex.get_time_regex(True)),
                  CWRField('Recorded indicator', regex.get_flag_regex()),
                  CWRField('Text music relationship', regex.get_alpha_regex(3, True)),
                  CWRField('Composite type', regex.get_alpha_regex(3, True)),
                  CWRField('Version type', regex.get_alpha_regex(3)),
                  CWRField('Excerpt type', regex.get_alpha_regex(3, True)),
                  CWRField('Music arrangement', regex.get_alpha_regex(3, True)),
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'AGR')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Submitter number', regex.get_alphanumeric_regex(14)),
                  CWRField('International standard number', regex.get_alphanumeric_regex(14, True)),
                  CWRField('Type', regex.get_alpha_regex(2)),
                  CWRField('Start date', regex.get_date_regex()),
                  CWRField('End date', regex.get_date_regex(True)),
                  CWRField('Retention end date', regex.get_date_regex(True)),
                  CWRField('Prior royalty status', regex.get_defined_values_regex(1, False, 'A', 'D', 'N')),
                  CWRField('Prior royalty status date', regex.get_date_regex(True)),
                  CWRField('Post_term collection status', regex.get_defined_values_regex(1, False, 'D', 'N', 'O')),
                  CWRField('Post_term collection end date', regex.get_date_regex(True)),
                  CWRField('Signature date', regex.get_date_regex(True)),
                  CWRField('Works number', regex.get_numeric_regex(5)),
                  CWRField('Sales Manufacture clause', regex.get_defined_values_regex(1, True, 'N', 'S')),
                  CWRField('Shares change', regex.get_boolean_regex(True)),
                  CWRField('Advance given', regex.get_boolean_regex(True)),
                  CWRField('Society assigned number', regex.get_alphanumeric_regex(14, True))]

        super(AgreementRecord, self).__init__(record, fields)
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'NWR')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Interested party ID', regex.get_ascii_regex(9)),
                  CWRField('Writer name', regex.get_ascii_regex(160)),
                  CWRField('Writer first name', regex.get_ascii_regex(160)),
                  CWRField('Language code', regex.get_alpha_regex(2, True))]

        super(NRWriterNameRecord, self).__init__(record, fields)
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'ORN')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Intended purpose', regex.get_ascii_regex(3)),
                  CWRField('Production title', regex.get_ascii_regex(60, True)),
                  CWRField('CD identifier', regex.get_ascii_regex(15, True)),
                  CWRField('Cut number', regex.get_numeric_regex(4, True)),
                  CWRField('Library', regex.get_ascii_regex(60, True)),
                  CWRField('BLT', regex.get_ascii_regex(1, True)),
                  CWRField('Visan version', regex.get_numeric_regex(8, True)),
                  CWRField('Visan isan', regex.get_numeric_regex(12, True)),
                  CWRField('Visan episode', regex.get_numeric_regex(4, True)),
                  CWRField('Visan check digit', regex.get_numeric_regex(1, True)),
                  CWRField('Production ID', regex.get_ascii_regex(12, True)),
                  CWRField('Episode title', regex.get_ascii_regex(60, True)),
                  CWRField('Episode ID', regex.get_ascii_regex(20, True)),
                  CWRField('Production year', regex.get_numeric_regex(4, True)),
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'PER')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Last name', regex.get_ascii_regex(45)),
                  CWRField('First name', regex.get_ascii_regex(30, True)),
                  CWRField('CAE IPI name', regex.get_ascii_regex(11, True)),
                  CWRField('IPI base number', regex.get_ascii_regex(13, True))]

        super(PerformingArtistRecord, self).__init__(record, fields)
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'AGR')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Submitter number', regex.get_alphanumeric_regex(14)),
                  CWRField('International standard number', regex.get_alphanumeric_regex(14, True)),
                  CWRField('Type', regex.get_alpha_regex(2)),
                  CWRField('Start date', regex.get_date_regex()),
                  CWRField('End date', regex.get_date_regex(True)),
                  CWRField('Retention end date', regex.get_date_regex(True)),
                  CWRField('Prior royalty status', regex.get_defined_values_regex(1, False, 'A', 'D', 'N')),
                  CWRField('Prior royalty status date', regex.get_date_regex(True)),
                  CWRField('Post_term collection status', regex.get_defined_values_regex(1, False, 'D', 'N', 'O')),
                  CWRField('Post_term collection end date', regex.get_date_regex(True)),
                  CWRField('Signature date', regex.get_date_regex(True)),
                  CWRField('Works number', regex.get_numeric_regex(5)),
                  CWRField('Sales Manufacture clause', regex.get_defined_values_regex(1, True, 'N', 'S')),
                  CWRField('Shares change', regex.get_boolean_regex(True)),
github weso / CWR-Validator / src / models / records.py View on Github external
def __init__(self, record):
        fields = [CWRField('Record type', regex.get_defined_values_regex(3, False, 'IPA')),
                  CWRField('Transaction number', regex.get_numeric_regex(8)),
                  CWRField('Record number', regex.get_numeric_regex(8)),
                  CWRField('Agreement role code', regex.get_alpha_regex(2)),
                  CWRField('CAE IPI ID', regex.get_ascii_regex(11, True)),
                  CWRField('IPI base number', regex.get_numeric_regex(13, True)),
                  CWRField('ID', regex.get_ascii_regex(9)),
                  CWRField('Last name', regex.get_ascii_regex(45)),
                  CWRField('Writer first name', regex.get_ascii_regex(30, True)),
                  CWRField('PR society', SocietyAffiliation.REGEX),
                  CWRField('PR share', regex.get_numeric_regex(5)),
                  CWRField('MR society', SocietyAffiliation.REGEX),
                  CWRField('MR share', regex.get_numeric_regex(5)),
                  CWRField('SR society', SocietyAffiliation.REGEX),
                  CWRField('SR share', regex.get_numeric_regex(5))]

        super(InterestedPartyRecord, self).__init__(record, fields)