Views filter field search without spaces (drupal 8)

Drupal 9 image field migration

The issue related to the custom website with custom field for phone. It has spaces. One of the solution is to remove spaces on presave and process the old entries in DB removing the spaces.
But sometimes it better not to touch thing that works.
The task was to provide search by phone filter in views. There are no default methods in views to search with removed spaces. In this case I've found a solution to alter the query.
So for example the phone fields value is "+354 566 32 56" and we need to find it by searching "6632" string.
This code will help you with it: