Search for Partial String and Return Full String
D
Duke Hillard
On occasion, I search for a partial string in phpMyAdmin because I don't know the full string. This is often a link that a client created using a CDN rather than domain name. Since I know how CDN names are formed, I can find it in phpMyAdmin. Still, I would love to enter the partial string in Better Search Replace and have it return all results with full strings. Then, I could use a full string in a search and replace operation.
Kevin Hoffman
Duke Hillard Thanks for the feedback. I understand your use case. In Better Search Replace Pro, you can preview detailed results which show the partial string in the context of the full string (see screenshot). This feature is also available in WP Migrate Pro. Is this the type of functionality you are looking for?
D
Duke Hillard
Kevin Hoffman: I can't tell from the screenshot nor from the list of features on the website (https://bettersearchreplace.com/). I will describe my dilemma.
Some clients, when editing content, are copying & pasting links from their websites (instead of creating them within the builder). Quite often, they use links whose URIs include the CDN rather than the FQDN. Interestingly, CDNs change over time, so some clients have domains from 3 or 4 CDNs on their sites. Then, one day, the CDN links break. In most cases, the subdomains for the CDNs changed. If I know the full CDN (with subdomain), I can use BSR to replace with the FQDN. However, I was hoping to replace all of the CDNs with BSR (i.e., those that I know and those that I don't). If a client used all 3 of the domains below, I would want to find and match all 3 even though I know only 1 of them. If this was a CLI, I would use regex.
CDNs
subdomain123abc.cdn.tld
subdomain456def.cdn.tld
subdomain789ghi.cdn.tld
FQDN
www.client.tld
Kevin Hoffman
Duke Hillard: Thanks, I understand the use case now. Based on the examples you provided, you would be best served by using WP Migrate Pro to do a find and replace with regular expressions.
Alternatively you could use the preview feature of Better Search Replace Pro to search for "subdomain" and gather the full URLs that are returned in the results.