ExtractEmailTransformer

Extracts email addresses from the given value.

javascript · Filters And Transformers

Source

function extract(values) {
    // Extracts email addresses from a list of values.
    // values: Array of strings.

    const listResults = [];

    for (const val of values) {
        listResults.push(...((val || '').toLowerCase().match(emailRegex) || []));
    }

    return listResults;
}

try {
    const values = argToList(args.value);
    const results = extract(values);
    return results;
} catch (error) {
    throw 'Error occurred while running the script:\n' + error;
}

README

Extracts email addresses from the given value.

Note: email addresses are case-insensitive. Results of this script are always lower case, to prevent creation of duplicate indicators.

Script Data

Name Description
Script Type javascript
Tags transformer
Cortex XSOAR Version 6.11.0

Inputs

Argument Name Description
value the input value.

Outputs

There are no outputs for this script.