Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Coldfusion Regex find question

Avatar of roger v
roger vFlag for United States of America asked on
ColdFusion LanguageRegular Expressions
16 Comments1 Solution247 ViewsLast Modified:
I have an xml element in a struct. I need to find some values in that xml document.

My example code is attacehd. I need to find the value that is between the <leadId> and </leadId> element, as well as the value in the attribute of <error code="0">need to find this text</error>

So I need something like:
myLead = ReFind(myXMLFile, "regex pattern")
myErrorCode and myErrorText

How do I do this?

<?xml version="1.0" encoding="utf-8"?> <postResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.xxxxx.com/xxxxxx/services/2008/09/indry.asmx">  <leadId>0</leadId>  <successful>false</successful>  <message>Error occurred, see errors for details</message>  <errors>  <error code="0">Invalid Postal Code (34343)</error>  </errors> </postResponse>
Avatar of gdemaria
gdemariaFlag of United States of America image

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

This problem has been solved!
Unlock 1 Answer and 16 Comments.
See Answers