• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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'+<[email protected]>"

the string can also be just "'test'+<[email protected]>"

any help is appreciated ..
 
Marshal
Posts: 80958
525
  • 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'+<[email protected]>" or just any email id i.e - [email protected]

from this "'test+test'+<[email protected]>" 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'+<[email protected]>" or just email id "[email protected]" without first and last name
 
Sheriff
Posts: 22862
132
Eclipse IDE Spring TypeScript Quarkus 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
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic