troubleshooting Question

regex start at first instance

Avatar of Evan Cutler
Evan CutlerFlag for United States of America asked on
Regular ExpressionsJava
2 Comments1 Solution374 ViewsLast Modified:
I am trying to extract text using a regex command....but I don't want to start from the beginning.

<sections> <id_root>90b40a38-ea32-9c2f-f2b8-9ad32f7b47fe</id_root> <code_code>34084-4</code_code> <code_codeSystem>2.16.840.1.113883.6.1</code_codeSystem> <displayName>ADVERSE REACTIONS SECTION</displayName> <section_title>6    ADVERSE REACTIONS</section_title> <effectiveTime_value>20120213</effectiveTime_value> <excerpt_text><![CDATA[ <ns1:paragraph>Common adverse reactions in clinical trials (=5% and more common than with placebo) include hypoglycemia, headache, nausea, and dizziness (<ns1:linkHtml href="#S6.1">6.1</ns1:linkHtml>).</ns1:paragraph>]]></excerpt_text> <subSections>

This is a snippet of a string.  I understand it looks like XML, but I have to treat it like a single string.

I need to use REGEX to find the information  from the tag <section_title>
Is there a way to regex (start from pos(look for <section_title>)) then go to the end tag?

Thanks much.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros