javascript - RegeX to validate Email OR Phone No. OR URL -


hi ask if possible create regex var regex = (valid email)|(any number 1 15 digits)|(url protool(https|https) , without (www.google.com)))

valid http://www.google.com www.google.com sample.s.sample@gmail.com sample.s@gmail.com 1 12 .. 15 invalid testemailinvalid.test.yahoo2 aaaaa aaaaaaaa sasasa 

i have regex expression regarding when put number validation in middle number not accepted.and when put last email input not accepted

var re =  (/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[a-za-z]{2,}))+(-(^[0][1-9]+)|([1-9]\d*))|(((?:https?\:\/\/|www\.)(?:[-a-z0-9]+\.)*[-a-z0-9]+.*))$/); 

i recode of regex , working did add + sign in end of second chunk of expression

var re =  (/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[a-za-z]{2,}))+(-(^[0][1-9]+)|([1-9]\d*))|+(((?:https?\:\/\/|www\.)(?:[-a-z0-9]+\.)*[-a-z0-9]+.*))$/); 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -