Extract substring (email)

Hello I wish to extract Substring from “Provizija ALIX.SERS@SB.CHTI FEBRUAR 2023”
I Would like to extract email address so “ALIX.SERS@SB.CHTI”

split the string into an array of strings by using var = yourstring.split(" "c) then you can use email = var(1).tostring

or you can use this regular expression : \b[A-Z0-9._%±]+@[A-Z0-9.-]+.[A-Z]{2,4}\b

Hi @tomaz ,

Check this below code,
emailStr(String As data type) = System.Text.RegularExpressions.Regex.Match("Provizija ALIX.SERS@SB.CHTI FEBRUAR 2023","[A-z.]+@[A-z.]+").Value

Hope this may help you :slight_smile:

@tomaz

Please try this

System.Text.RegularExpressions.Regex.Match(str,"\S*(?=@)\S*").Value

cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.