Jump to content
UBot Underground

Recommended Posts

Hi ,

 

I'm stuck in this :(  

 

I need to validate mobile number :

 

The number may start with +9665 or 009665 or 05 OR 9665  

The next digit after the 5 can be from 0 to 9 

Then after that exact 7 digit.

 

 

What i did so far by this site 

 


 

^(?:\+?966)[5]\d{8}$

 

 

I couldn't do the 009665 / 05 

 

Any suggestions appreciated :)

 

I forget the 9665  i add it  :wacko: 

Edited by UBot Marketer
Link to post
Share on other sites

This any good?

 

^(?:\+?.*)[5]\d{8}$

 

http://rubular.com/r/eJI6kl4pw1

 

Thanks for your try :)  

 

Almost  BUT it scraped the numbers start with 66 and 55 ( and i do not want them )

 

Thanks again , i think i will go with my tallllllllll string  :wacko:

 

^(009665|9665|\+9665|05)(5|0|3|6|4|9|1)([0-9]{7})$

Link to post
Share on other sites

give me examples of full numbers your trying to get ? 

 

also i worked on this some what adn i think the easiest thing would be to reg the items in diff var then bring them togther in a new list ?

Link to post
Share on other sites

give me examples of full numbers your trying to get ? 

 

also i worked on this some what adn i think the easiest thing would be to reg the items in diff var then bring them togther in a new list ?

 

 

 

The numbers will be either 

 

 

+9665xxxxxxxx

009665xxxxxxxx

9665xxxxxxxx

05xxxxxxxx

 

The ( x ) is 8 digits 

 

 

 

Hi Bakr,

 

How about this?

 

http://rubular.com/r/KmynLZ6iP2

 

Thanks great  , still did NOT get the one start with ( 9665 ) i know it is my mistake i forgot to add it to the post sorry

Link to post
Share on other sites

Ubot Marketer, keep in mind thought that the speed of a regular expression is not necessarily related to how short or long it is. I use this:

 

http://regexhero.net/tester/

 

You can run benchmark tests for the different versions for a start.

 

 

Thanks for the heads up , i am not expert in Regex 

 

and i thought it will be much accurate and faster if it as Symbols

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...