aspose file tools*
The moose likes Java in General and the fly likes REgular Expression for string validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "REgular Expression for string validation" Watch "REgular Expression for string validation" New topic
Author

REgular Expression for string validation

Anjali Naveen
Greenhorn

Joined: Jun 28, 2005
Posts: 15
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
Marshal

Joined: Mar 22, 2005
Posts: 41880
    
  63
What do you have so far?


Ping & DNS - my free Android networking tools app
Urs Waefler
Ranch Hand

Joined: Mar 13, 2007
Posts: 77
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


SCJP 1.4
Alan Moore
Ranch Hand

Joined: May 06, 2004
Posts: 262
Anjali Naveen
Greenhorn

Joined: Jun 28, 2005
Posts: 15
thanks a ton Allan..that really helped!!...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: REgular Expression for string validation