This content has been marked as final. Show 3 replies
It looks like a job for regular expressions. Those are not my strength, so I can't be more specific.
Since my post I have found an answer to my own question.
In order to extract the domain from a string such as email@example.com/photos
you can use the following code as one solution:
Firstly you want to extract the domain and path from the username and "@" sign:
<cfset string = "firstname.lastname@example.org/photos">
<cfset startString = ListLst(string, "@")>
the var "startString" will now display: domain.com/photos
secondly, you now want to remove the path from the domain:
<cfset domainOnly = ListFirst(startString, "/")
This will display: domain.com
I hope this is of use to someone.
There was one error in my previous post: