Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help me for validation of email address using regex

 
Raveendra Mutyala
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends ,
can any one help me in solving the errors for validation email address using the code or any other code if other had u can send me if u like..

this code is there in http://java.sun.com/developer/technicalArticles/releases/1.4regex/
but it is not working..

 
Scott Selikoff
author
Saloon Keeper
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's broken about it? Also, what version of java are you using? I've seen this code (as well as many variations on it such as in PHP) and it usually works pretty well.
 
Raveendra Mutyala
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i am using Websphere studio application development 5.1.2 version .
it is giving error at p.matcher(input);

Error:
The method matcher(CharSequence) in the type Pattern is not applicable for the arguments (String)EmailValidation.java

so kindly can u suggest me the solution to solve this problem.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are your import statements? It sounds like you're not using the correct String or Pattern class, as all Strings implement CharSequence interface.
 
Raveendra Mutyala
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Selikoff:
What are your import statements? It sounds like you're not using the correct String or Pattern class, as all Strings implement CharSequence interface.
import java.util.regex.*; is the only import statement i used in my program.
 
Scott Selikoff
author
Saloon Keeper
Posts: 4015
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, is it possible your JVM is set to 1.3? According to the API CharSequence has really only been around since 1.4 so any 1.3 versions of java.lang.String would give the error you're seeing. I'd check your class path and jvm properties.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic