Modify core search block with regex

<?php

/** Filters the search block form to replace the "s" input with your Search facet. Change "_keywords" (the Search facet's name) as needed.
 ** This also replaces the default action with the page URL of your custom search results page. Change the "/site-search/" permalink as needed. 
 ** See: https://facetwp.com/redirect-a-search-box-to-a-facetwp-results-page/
 */

add_filter('render_block', function ($block_content = '', $block = []) {
    if (isset($block['blockName']) && 'core/search' === $block['blockName']) {
        $block_content = preg_replace('/action="(.*?)"/', 'action="/site-search/"', $block_content);
        $block_content = preg_replace('/name="(.*?)"/', 'name="_keywords"', $block_content);
    }
    return $block_content;
}, 11, 2);