Regular expression matching text (Size) in javascript


/ Published in: JavaScript
Save to your folder(s)

Matches the word starting with si or Si and containing : in the word also as an optional. The expression can be tested here http://rejex.heroku.com/


Copy this code and paste it in your HTML
  1. var pattSize=new RegExp("^[si|Si][a-zA-Z:/]+$");
  2.  
  3. if(pattSize.test(att) ){
  4.  
  5.  
  6. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.