File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

REgular Expression for string validation

 
Anjali Naveen
Greenhorn
Posts: 15
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far?
 
Urs Waefler
Ranch Hand
Posts: 77
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Anjali Naveen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a ton Allan..that really helped!!...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic