I have this so far:
<?php
$pattern = "xrc.pqmt.somedomain.com";
$pattern = preg_replace("/.*(\w*\.\w*)$/i", "$1", $pattern); // need only: somedomain.com (or some-domain.com if hyphenated)
echo $pattern;
?>
But all I am getting is: .com
What I need is: somedomain.com
Or, if it is a hyphenated one: some-domain.com
Umh, of course, things like: my258.com or: my-258.com, etc.
Thanks much.
(EDIT🙂 Darn...the blackslashes won't show in the post.
I'll try it this way:
<?php
$pattern = "xrc.pqmt.somedomain.com";
$pattern = preg_replace("/.(\w.\w*)$/i", "$1", $pattern); // need only: somedomain.com (or some-domain.com if hyphenated)
echo $pattern;
?>