This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Java in General and the fly likes REgular Expression for string validation Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 35240
    
    7
What do you have so far?


Android appsImageJ pluginsJava web charts
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
 
Similar Threads
String replacement
Regular Expression Help Needed
regular expression in java question!
Recursive Regular Expression
List to String