I used below REST API with CQL and searching for all spaces with space.title match with given input, it returns spaces even space name does not match with the given input but input is matching the created by user name.
/rest/api/search?cql=type=space%20and%20space.title~%22testuser*%22
The above call returns even though there is no space name contains the word "testuser" and all spaces created by user "testuser" or "testuser1" etc..,
Is there any other REST API where I want to do regex search in space name (as well as space key, not complete key)?