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) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -