Is there a way to create a single rewrite rule to handle multiple variables depending on what is present?

I was able to make this work by using a power set function and then using that array to create individual rewrite rules.

add_action('init', 'ebd_custom_rewrite_rules');
function ebd_custom_rewrite_rules() {
    $taxonomies = array( 'engine-work', 'engine-specialty', 'application-specialty', 'machining-capability', 'dyno-facility', 'shop-region');
    $combinations = ebd_get_array_power_set($taxonomies);
    $element_size_min = 2;
    foreach ($combinations as $combination) {
        if ($element_size_min <= count($combination)) { // skip singles - already defined by taxonomy
            $regex = '^'; //init regex string
            $query = 'index.php?'; //init query string
            $number_of_slugs = 1; //keep track of the index we're on
            foreach (array_reverse($combination) as $taxonomy_slug) { //array_reverse to preserve order
                $regex .= $taxonomy_slug.'/(.*)/'; //add taxonomy to regex
                $query .= $taxonomy_slug.'=$matches['.$number_of_slugs.']&'; //add taxonomy to query
                $number_of_slugs++; //increase count
            }
            $regex = substr($regex, 0,strrpos($regex,"https://wordpress.stackexchange.com/")).'?'; //remove last slash
            $query = substr($query, 0,strrpos($query,'&'));//remove last ampersand
            add_rewrite_rule($regex, $query, 'top');
        }
    }
}

function ebd_get_array_power_set($array) {
    $results = array(array( ));

    foreach ($array as $element)
        foreach ($results as $combination)
            array_push($results, array_merge(array($element), $combination));

    return $results;
}

Power Set Ref.

deneme bonusudeneme bonusu veren sitelerpulibet girişOnwin Güncel Giriştürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişholiganbetholiganbet girişholiganbet güncel giriş