I am trying to use Regex to match a word within a www URL. In the event that the www does not exist, I would still like it to match on the '.com'. For example if the following text was present...
www.anything.com
anything.com
It would return "anything" as the result. In the event that the 'www' is not present, it could still get it from the word before '.com'. But if the 'www' is present, I would like it to look there first.
Any thoughts?