I'm struggling with extracting from URL only country for example .pl from https://www.google.pl.
At this moment I'm able to extract google.pl from provided url using the following code:
TRIM(REGEXP_EXTRACT(REGEXP_REPLACE(REGEXP_REPLACE(URL, "https?://", ""), R"^(w{3}\.)?", ""), "([^/?]+)"))
What is needed to change in this code to provide only .pl instead of example.pl?
Thanks in advance.