• Post Reply Bookmark Topic Watch Topic
  • New Topic

regex question  RSS feed

 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need regular expression for this string "'test+test'+<test.test@gmail.com>"

the string can also be just "'test'+<test@gmail.com>"

any help is appreciated ..
 
Campbell Ritchie
Marshal
Posts: 56545
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That looks easy enough; what have you tried? Regular expressions website with tutorial. Java™ Tutorials section
 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue i need to solve is sometimes the string is "'test+test'+<test.test@gmail.com>" or just any email id i.e - test.test@gmail.com

from this "'test+test'+<test.test@gmail.com>" i m able to get email id using the below regex

String regex = "[^<]*[^>]";

But i m not able to use a if condition to decide whether the url string is "'test+test'+<test.test@gmail.com>" or just email id "test.test@gmail.com" without first and last name
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use JavaMail:
Output:
You will need to parse the personal part a bit more, but at least you can filter out the email address.
 
divya kundapur
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Use JavaMail:
You will need to parse the personal part a bit more, but at least you can filter out the email address.


THANK YOU THANK YOU VERY MUCH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!