Closed gcfabri closed 6 years ago
Hi @gcfabri - You need to verify that the content being returned by Skype channel is actually a plain-text email address. Sometimes Skype wraps email addresses in HTML tags, so you would need to adjust your RegEx accordingly.
On Skype channel you need to check for: <a href="mailto:name@email.com">name@email.com</a>
@nwhitmont , I personally think this is a bad solution as the field that's being filled now also contains the ... which is infact not a valid URL. This would mean we would have to manually implement code to parse this again.
I'm not sure what a good solution would be (e.g. either enforce skype to send non URL messages if it's talking to a bot, or create an attribute that parses our the URL). But I think this issue should be reopened.
I'm facing the same problem with Slack, I tried using the following PromptValidator but still didn't get it to work . (SDK v4)
public static PromptValidatorEx.PromptValidator<TextResult> GetEmailValidator(string scapeKeyword = "", string message = null) {
return async (ITurnContext context, TextResult result) => {
string email = Regex.Replace(result.Value.Trim(), @"(<a[^>]+>)(.*?)(<\/a>)", (m) => m.Groups[2].Value);
try
{
var value = new System.Net.Mail.MailAddress(email);
result.Value = value.Address;
}
catch
{
result.Status = PromptStatus.NotRecognized;
await context.SendActivity(message ?? $"{email} is an invalid email");
}
};
}
Hi,
I tried doing the following - var newGroupMailboxEmailAddress = Regex.Replace(MailboxrequestFormData.GroupMailboxEmailAddress, "</?(a|A).*?>", ""); This will remove the hyperlinks while saving the data and the data gets saved without any error.
Above values are coming from FormFlow.
Hi All,
I was facing the same issue and I found the below regular express which resolved my issue.
@"\b(?!mailto\:)([\w-]+(.[\w-]+)@([a-z0-9-]+(.[a-z0-9-]+)?.[a-z]{2,6}|(\d{1,3}.){3}\d{1,3})(:\d{4})?)"
Thanks
Bot Info
Issue Description
I built a bot using Bot Framework (node.js) with four connected channels (Messenger, Telegram, Skype and Web). At any moment the bot validates an inputted email address using a regular expression like this below:
It is working properly on all channels, except the Skype. E.g: gcfabri@gmail.com match with this regex but on Skype channel it doesn't happens.
Code Example
emailRegex.test(
gcfabri@gmail.com);
Expected Behavior
The email address gcfabri@gmail.com should match with the regex above.
Actual Results
Skype channel just ignore the step with the regex validation.