• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ListLast with email address

Explorer ,
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

Hi,

I'm trying to determine whether anything comes after a given email address

e.g. email address: me@domain.com/emails

How can i determine whether "/emails" appears after the email domain?

Thanks
TOPICS
Advanced techniques

Views

269

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Oct 17, 2006 Oct 17, 2006
There was one error in my previous post:

Replace: <cfoutput>#domainOnly'</cfoutput>

with: <cfoutput>#domainOnly'#</cfoutput>

Votes

Translate

Translate
LEGEND ,
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

It looks like a job for regular expressions. Those are not my strength, so I can't be more specific.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

Hi,

Since my post I have found an answer to my own question.

In order to extract the domain from a string such as me@domain.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 = "me@domain.com/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, "/")

<cfoutput>#domainOnly'</cfoutput>

This will display: domain.com

I hope this is of use to someone.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 17, 2006 Oct 17, 2006

Copy link to clipboard

Copied

LATEST
There was one error in my previous post:

Replace: <cfoutput>#domainOnly'</cfoutput>

with: <cfoutput>#domainOnly'#</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation