> 
> **Possible Duplicate:**  
> 
> [Regular Expression for validating numbers with one space and one optional special character](https://stackoverflow.com/questions/13717990/regular-expression-for-validating-numbers-with-one-space-and-one-optional-specia) 
> 
> 
> 

I have to write a regular expression to validate mobile numbers which look like below:

a).Maximum 12 characters

b).Will allow a space (at a non-defined point)

c).Must start with 0

d).Followed by an optional extension number of up to five digits in length, not including the # sign

I have tried with the following to get 0-12 numbers. but i don't know how to add the optional extension numbers part (the # and followed by numbers)

```
^(0(?:\d{0,11}|(?=\d* \d*$)[\d ]{0,12}))$ 

```