Regex Email addresses out of xml

RellecT

New Member
My question: What's a good way to parse the information below?I have a java program that gets it's input from XML. I have a feature which will send an error email if there was any problem in the processing. Because parsing the XML could be a problem, I want to have a feature that would be able to regex the emails out of the xml (because if parsing was the problem then I couldn't get the error e-mails out of the xml normally).Requirements:
  • I want to be able to parse the to, cc, and bcc attributes seperately
  • There are other elements which have to, cc, and bcc attributes
  • Whitespace does not matter, so my example may show the attributes on a newline, but that's not always the case.
  • The order of the attributes does not matter.
Here's an example of the xml:\[code\]<error_options to="your_email@your_server.com" cc="cc_error@your_server.com" bcc="bcc_error@your_server.com" reply_to="someone_else@their_server.com" from="[email protected]" subject="Error running BONotifier at @@TIMESTAMP@@" force_send="false" max_email_size="10485760" oversized_email_action="zip;split_all">\[/code\]I tried this \[code\]error_options.{0,100}?to="(.*?)"\[/code\], but that matched me down to \[code\]reply_to\[/code\]. That made me think there are probably some cases I might miss, which is why I'm posting this as a question.
 
Back
Top