*shrug* Almost did give a solution similar to that, but then decided to go for
a regex one since that's what was specifically asked for.
But reconsidering, I agree - I should've gone for the more readable one...
<cfset Names = ArrayNew(1)/>
<cfloop index="thisRow" list="#Data#" delimiters="#Chr(10)#">
<cfif Find('<20>',thisRow)>
<cfset ArrayAppend(Names, ListFirst(thisRow,' '))/>
</cfif>
</cfloop>
<cfdump eval="Names"/>
> Why wouldn't you just loop over the cfexecute's return using crlf as
> the delim and a simple find("<20>",currentline) statement in the loop?
> If true treat the currentline as a space delimned list and
> trim(ListFirst(currentline," ")).
>
> Maybe not as elegant, but at least you can read it.
>
> Mik
>
>
> At 05:02 PM 3/1/2007, Peter Boughton wrote:
> >Not convinced this is the best way, but it works:
> >
> ><cfset Result = REReplace(Data,
> '(\n([^<]*?)<([^2][0-9A-F]+|2[^0][0-9A-F]*|20[0-9A-F]+)>[^\n]*)+',',',
> 'all')/>
> ><cfset Result = ListToArray(REReplace(Result,'\s*,\s*([^<\s]*)[^,]*',
> ',\1','all'))/>
> >
> >(First REReplace isolates any <20> lines, second one cuts out
> non-name data and converts to array)
> >
> >
> >
> >> How would one of you regex skilled people find the name on the line
>
> >> that has a <20> in it, there maybe more then one line like this.
> >>
> >
> >> Name Type Status
> >>
> >
> >> ---------------------------------------------
> >>
> >
> >> ISKINNER-SVR <00> UNIQUE Registered
> >>
> >
> >> SMFNT <00> GROUP Registered
> >>
> >
> >> ISKINNER-SVR <20> UNIQUE Registered
> >>
> >
> >> ISKINNER-SVR <03> UNIQUE Registered
> >>
> >
> >> SMFNT <1E> GROUP Registered
> >>
> >
> >> INet~Services <1C> GROUP Registered
> >>
> >
> >> IS~ISKINNER-SVR<00> UNIQUE Registered
> >>
> >
> >> ISKINNER <03> UNIQUE Registered
> >>
> >
> >> ISKINNER-SVR <01> UNIQUE Registered
> >>
> >>
> >>
> >>
> >>
> >> --------------
> >> Ian Skinner
> >> Web Programmer
> >> BloodSource
> >> www.BloodSource.org
> >> Sacramento, CA
> >>
> >> ---------
> >> | 1 | |
> >> --------- Binary Sudoku
> >> | | |
> >> ---------
> >
> >>
> >> "C code. C code run. Run code run. Please!"
> >> - Cynthia Dunning
> >>
> >> Confidentiality Notice: This message including any
> >> attachments is for the sole use of the intended
> >> recipient(s) and may contain confidential and privileged
> >> information. Any unauthorized review, use, disclosure or
> >> distribution is prohibited. If you are not the
> >> intended recipient, please contact the sender and
> >> delete any copies of this message.
> >>
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2
Build sales & marketing dashboard RIAâs for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:271222
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4