To be honest, this sound like a duplicate post, but this is totally different from other post.

I'm building a chat room, where i would like to detect mobile number in user sending messages and warn the users that sending mobile numbers in the chat room is not safe and its against our policy.

There are few posts shows how to detect US number. But what about Indian numbers? they are 10 digit numbers.

```
var input = "hey im emily, call me now 9876543210"

```

I have to detect the number in all these formats.

> 
> 9876543210
> 
> 
> 9 8 7 6 5 4 3 2 1 0
> 
> 
> 98765 43210
> 
> 
> +919876543210
> 
> 
> +91 9876543210
> 
> 
> 

Some smart users always comes up with a smart way to come around those filters used in the client side javascript. So i have to be well prepared to detect all the method they use.

**Example Message :**

> 
> "hey this is emy, call me now 9876543210"
> 
> 
> 

Expected output : pop up saying, hey buddy, sending numbers in the room is not safe and not allowed here.

Note: The string message should be allowed to send upoto 5 digit numbers, without getting the alert pop up. Or if you have any better idea? suggest me and we can make it work. Thanks