Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parse a string with coldfusion

Posted on 2010-09-23
2
Medium Priority
?
430 Views
Last Modified: 2012-05-10
I have a http post that will return a string like the example below.
I need to get the value of qualified.

The string will not always be in same exact character length.
How do i search string for [qualified] => then set the value to result.

<cfset result =

Array ( [success] => 1 [leadID] => 8001640 [qualified] => 1 )
0
Comment
Question by:LeadCo
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 33750678
<cfset result = "">
<cfset str = "Array ( [success] => 1 [leadID] => 8001640 [qualified] => 1 ) ">
<cfset matches = reMatchNoCase("(\[qualified\]\s+=>\s+[^\[\)]+)", str)>
<!--- if found --->
<cfif arrayLen(matches)>
      <cfset result = listLast(matches[1], "=>")>
</cfif>
<cfoutput> result = #result# </cfoutput>
0
 

Author Closing Comment

by:LeadCo
ID: 33938939
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question