I have one table pages which has url
field. I want to filter those records by domain name.
Below are the sample domains from list of URL.
I checked this answer. But REGEXP_REPLACE is not working in where condition.
Below is the query that I tried but it is only allowing to filter by hostname, I want regex which work for the domain name.
Page.where("substring(url from '.*://([^/]*)') in (?)", ['test.host'])
The request parameter for domains will be ['http://test.host'] not ['test.host'].
I am looking for the best solution to tackle this problem. Thank you in advance.