Here is a utility method to check if a given String is a valid Social Security number using Java Regular Expression.
Here is another method from my String utility class. This method uses a regular expression to check if a String is a numeric value. Look at the code, then read through the explanation that follows
My earlier post on how to validate email address, SSN and phone number validation using Java regex still attracts a lot of visitors. Today I realized that another piece of data that many programmers need to validate is the date. Many Java applications have to process input date values, so I thought it will be […]
An example on how to validate if a String variable in Java has all numeric digits.
My post about Java regular expression gets a lot of hits daily. Someone commented that the regular expression I included in that post does not block certain invalid email addresses. So I updated the Java regular expression to validate email address. I am pretty sure that the following Java regular expression will validate any email […]
Regular expressions provide a powerful and flexible way to search for phrases or characters but they are also confusing and many developers find them quite daunting. If you have been reluctant to learn regular expressions because of their apparent complexity, fear no more.
Regular Expressions offer a concise and powerful search-and-replace mechanism. They are patterns of characters used to perform a search, extract or replace operations on the given text. Regular expressions can also be used to validate that the input conforms to a given format. For example, we can use Regular Expression to check whether the user […]