Help coderanch get a
new server
by contributing to the fundraiser

Girish Havaldar

Greenhorn
+ Follow
since Nov 01, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Girish Havaldar

Hi,

How to demonstrate all OOPs concepts in a Singal Java program file.

Regards,

Girish
12 years ago
Thanks Mohamed,
since the conditions are very confusing, can you give me some hint on how to proceed.
13 years ago
Hi,
I am new to Java Regex, i have a requirement in which i need to write java regex for validating ip address keeping in mind the below points.
Basically i need to validate the search key word, which a user enters.


1) IP-address notation dictates that is consists of 4 “dotted-decimals” – i.e. 4 “digit strings” that are separated by a “.” (dot).
Each dotted-decimal is between 1-3 digits long and value of a dotted-decimal number must be between 0-255 to be valid.
Example of valid IP-address notation: 0.0.0.0 or 1.2.3.4 or 23.34.45.56 or 255.255.255.255 (>256 is not valid)

2) Example of allowed inputs:

a) dotted-decimal: .1 or 1. (note: could be with or without leading/trailing “.” !)
b) dotted-decimals: 1.2 or .2.3 or .2.3. or .3.4 (note: could be with or without leading/trailing “.” !)
c) dotted-decimals: 1.2.3 or 1.2.3. or .2.3.4 (note: could be with or without leading/trailing “.” !)
d) dotted-decimals: 1.2.3.4 (note: could be with or without leading/trailing “.” !)


Need Regex pattern for the above.

Thanks in Advance.

Regards,

Girish

13 years ago