• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

regex question

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ..
 
Marshal
Posts: 79411
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 22785
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic