Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Featured Replies

Hi all friends

I tried to make a CF (recursive) to grab all the eMails from a given text ... but for now I do not got !

I thinked to count the words and so on...

but the "@" character is considered a delimiter of words (as comment kindly explained to me).

So I stopped !

The same CF can grab all the words with a given string inside them.

Kind of: GetWords(text;string)

PS: I can't find a similar CF in the brilliant Brian site

I don't see what difference it makes if "@" is a word delimiter or not. The question is how are your addresses separated from each other and from the rest of the text.

FWIW, Ray has a scripted e-mail extractor on his site, which you could adapt to a CF, but I have to warn you that it fails at perfectly valid addresses.

  • Author

Hi,

I solved my problem with this recursive custom function that grab all the emails from a given generic text:

GetEmail ( text ) custom function


/*

Author

Daniele Raybaudi

*/

Let([

count = PatternCount ( text ; "@" );

len = Length ( Text );

pos = Position ( Text ; "@" ; 1 ; 1 );

ante@ =  RightWords ( Middle (Text ;1 ;pos  ) ; 1 );

post@ =  LeftWords ( Middle (Text ; pos ; len ) ; 1 );

nextText = Middle ( text ; pos + 1 ; len )

];

Case(

count ; ante@ & "@" & post@ & "¶" & GetEmail ( nextText );

""

)

)

  • Author

Hi comment

there is a great difference!

If "@" is a delimiter of words, I can easily get the left side and the right side of it with RightWords and LeftWords , as I did !

I'd suggest you check out some references on what is a valid e-mail address, then see if your CF extracts all possible variations.

See for example:

http://www.ietf.org/rfc/rfc0822.txt

http://www.developer.com/lang/php/article.php/3290141

http://www.webreference.com/js/tips/000310.html

  • Author

ok

so my CF is, for now, good only for the most usually emails, NOT FOR ALL !

Thanks to comment.

BTW I'm reading that looongs links... and I'll search to implement all the possibilities !

  • Author

Hi

this works for all the emails !

/*

Author

Daniele Raybaudi

*/

Let([

adjustedText = Substitute ( text ; "¶" ; " " );

count = PatternCount ( adjustedText ; "@" );

len = Length ( adjustedText );

pos = Position ( adjustedText ; "@" ; 1 ; 1 );

startWord = Position ( adjustedText ; " " ; pos ; -1 ) + 1;

endWord = If ( Position ( adjustedText ; " " ; pos ; 1 ) ≠ 0 ; Position ( adjustedText ; " " ; pos ; 1 ) ; len + 1  );

word = Middle ( adjustedText ; startWord ; endWord - startWord );

nextText = Middle (adjustedText ; endWord + 1 ; len )

];

Case(

count ; word & "¶" & GetEmail ( nextText );

""

)

)

  • Author

And this works for all the words that contains a given string.

GetWords(text;string)


/*

Author

Daniele Raybaudi



modified 09/13/2005

*/

Consenti([

adjustedText = CercaeSost ( text ;  

["¶";" "];

[",";" "];

[".";" "];

[":";" "];

[";";" "];

["!";" "];

["?";" "];

[""";" "];

["(";" "];

[")";" "];

["%";" "];

["/";" "];

["*";" "];

["-";" "];

["[";" "];

["]";" "];

["'";" "];

["£";" "];

["$";" "];

["&";" "];

["=";" "];

["^";" "];

["+";" "];

["§";" "];

["°";" "];

["#";" "];

["_";" "];

["<";" "];

[">";" "];

["";" "]);

count = ContaRicorrenze ( adjustedText ; string );

len = Lunghezza ( adjustedText );

pos = Posizione ( adjustedText ; string ; 1 ; 1 );

startWord = Posizione ( adjustedText ; " " ; pos ; -1 ) + 1;

endWord = If ( Posizione ( adjustedText ; " " ; pos ; 1 ) ≠ 0 ; Posizione ( adjustedText ; " " ; pos ; 1 ) ; len + 1  );

word = Mezzo ( adjustedText ; startWord ; endWord - startWord );

nextText = Mezzo (adjustedText ; endWord + 1 ; len )

];

Casi(

count ; word & "¶" & GetWords ( nextText;string );

""

)

)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.