question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Skype] Regular expression not working to find email address in chat message?

See original GitHub issue

Bot Info

  • SDK Platform: Node.js
  • SDK Version: Bot Builder 3.13.1 with Botkit 0.6.7
  • Active Channels: Skype, Messenger, Telegram and Web
  • Deployment Environment: Azure Bot Service and Azure App Service

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:

/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i

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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
nwhitmontcommented, Jan 10, 2018

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>

0reactions
Harshgupta71commented, Jun 27, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

In this Skype web control generator, typing an email address ...
If user types some regular expression like (*** Email address is removed for privacy ***) then the line isn't showing in the chat...
Read more >
Bot Framework Skype channel regular expressions not working
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....
Read more >
Skype's Crazy Regex Easter Egg | Hacker News
Some experimentation shows that it isn't a full regular expression engine, it will only do straight word substitution. I think this is stretching...
Read more >
What is the full extent of s/old/new and /find in Skype commands ...
1 Answer 1 · 1 · @Arjan, sorry, I was trying to say that a lot of blog posts about this feature seem...
Read more >
skype-connect-troubleshooting-guide.pdf
3.2 You have Quality of Service (QoS) issues ... Skype Connect™, account management and billing queries by email or chat. ... message's telephone-event....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found