Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

help me for validation of email address using regex

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..

 
author
Posts: 4278
34
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4278
34
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4278
34
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic