java - How can i write the validation for number+string? -


i stuck small problem. think in java can write validation want smart logic.

in registration page there name field.

name should rahul0533 not 0533rahul..

for wrote logic getting first char in string , check.i think huge. please how can validate.

here in name field , name should not start special characters , numbers. remaining accepted.

try use regex validation

string name = "client name"; string patternstring = ""; // regexp pattern pattern = pattern.compile(patternstring); matcher matcher = pattern.matcher(name); 

regex basic syntax http://tutorials.jenkov.com/java-regex/syntax.html


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -