A Alisson Active Member Licensed User Mar 29, 2016 #1 Hello I need get the name domain name between '@' and '.' of the e-mail. Example: store@domainname.com Result: domainname I try one regx, but not have successful. I don't Known use the regex: Regex.Matcher("^(?i)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])$", "store@domainname.com") Click to expand... Someone can help me, please? Thanks very much!
Hello I need get the name domain name between '@' and '.' of the e-mail. Example: store@domainname.com Result: domainname I try one regx, but not have successful. I don't Known use the regex: Regex.Matcher("^(?i)[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])$", "store@domainname.com") Click to expand... Someone can help me, please? Thanks very much!
Erel B4X founder Staff member Licensed User Longtime User Mar 29, 2016 #2 This is exactly the default example in the online regex tool: https://b4x.com:51041/regex_ws/index.html You need to get group 2. Upvote 0
This is exactly the default example in the online regex tool: https://b4x.com:51041/regex_ws/index.html You need to get group 2.
DonManfred Expert Licensed User Longtime User Mar 29, 2016 #3 A simple split should do the trick. Split at @ Split result again at the dot. Upvote 0
A Alisson Active Member Licensed User Mar 29, 2016 #4 Erel and DonManfred. I found it: B4X: Dim data As String data = "john@gmail.com" Dim matcher1 As Matcher matcher1 = Regex.Matcher("@\w+\.", data) Do While matcher1.Find = True Log(matcher1.Match) Loop Thanks very much guys! Upvote 0
Erel and DonManfred. I found it: B4X: Dim data As String data = "john@gmail.com" Dim matcher1 As Matcher matcher1 = Regex.Matcher("@\w+\.", data) Do While matcher1.Find = True Log(matcher1.Match) Loop Thanks very much guys!