Extract Regex

ExtractRegex #

Extract a regexp result. Stores an empty string if not found.

[[step]]
    action = "ExtractRegex"
    out_label = "mytag"
    search = "^CT(..)CT"
    replacement = "$1"  # optional. standard regex replacement syntax
    source = "read1" # An input segment (to read from sequence), or name:<segment> to read from a read's name.

This transformation searches for a regular expression pattern in the specified read and extracts the matching portion as a tag.

The value actually ’extracted’ is after replacement has been performed.

See the regex documentation for details on the syntax supported.

Note that you need to ‘double up’ on backslashes for character classes inside the search string.