regex - Regular expression should match white space only if some test is entered -JS -


I currently have this regex / ^ [A-Za-z_] {3,20} $ /; The problem with this expression to validate the name in my website is that it matches three or more places! I did not enter any name and just confirmed it three times to enter the hit space! I just want to validate white spaces if I enter some text how to do this?

  / ^ [azza-jade] [azza-g_] {2 , $ 19 / $ /   

If you use it, space / undescores will be accepted only after one letter has already been entered.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -