I have a piece of html code that I extracted:
Server Address</span></td><td ><span class="hpPageText" >hostname0403.domain.tld</span></td><
From this string, I am trying to extract the fqdn (hostname0403.domain.tld). I figured I would use the following logic:
- begins with >, ends with <
- must include at least 1 period (dot).
- must include either all numbers, all letters, or a combination of both.
What I am hoping to end up with is ">hostname0403.domain.tld<" and from there I can strip off the ><. This is the reg that I have so far, which works, but I don't think it is accurate:
$reg = ">[\w\.]+<"
I am very new to regex and while this does work, i'm not sure if it is fail safe. Any help would be appreciated.