Accounting for search terms that may include a space, using SearchWP

Appreciate that this is in the wrong forum, but just incase this may be of some use to someone.

By using the following I can modify the search query, so that it matches the product titles. E.G if its “ABC 1” it will search for “ABC1”

function my_parse_searchwp_terms( $query, $engine ) {
   $query = preg_replace( '/(?<=abc)(\s+)(?=\d)/i', '', $query)
   return $query;
}

add_filter( 'searchwp_terms', 'my_parse_searchwp_terms', 10, 2 );