Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

REgular Expression for string validation

 
Anjali Naveen
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey need help to validate a string such that it contains atleast one UPPERCASE, one DIGIT and one SPECIAL CHARACTER. cant seem to get the regular expression for that!!please help
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far?
 
Urs Waefler
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I had a look at the class String, if there exist such methods. Till now I did not get a usefull idea. Once I thought, maybe you could the method:

public char[] toCharArray()

Then you have to parse an array. Probably there might be for each test one loop.

example:

for (int i = 0; i<array.length; i++){
if(array[i] == ...;
...
}

Regards
Urs
 
Alan Moore
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Anjali Naveen
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a ton Allan..that really helped!!...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic