You've almost got it.
http://www.cfquickdocs.com/?getDoc=REFindNoCase
If you add one final argument to REFind, that function will return an array
for you:
REFind("<a [[:space:]*[:punct:]*[:alnum:]*]>", qLinkReview.TextBlock, true)
If returnsubexpressions = "True": a structure that contains two arrays, len
and pos. The array elements are as follows:
If the regular expression is found in the string, the first element of the
len and pos arrays contains the length and position, respectively, of the
first match of the entire regular expression.
If the regular expression contains parentheses that group subexpressions,
each subsequent array element contains the length and position,
respectively, of the first occurrence of each group.
If the regular expression is not found in the string, the first element of
the len and pos arrays contains 0.
<!----------------//------
andy matthews
web developer
certified advanced coldfusion programmer
ICGLink, Inc.
[EMAIL PROTECTED]
615.370.1530 x737
--------------//--------->
-----Original Message-----
From: Millisa Eubanks [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 10, 2006 9:22 AM
To: CF-Talk
Subject: Extracting Data into an Array
I'm trying to find a simple way to go though a block of text and pull out
any occurace of links in that block of text. I'm not sure if the problems
I'm having are based on the function I am using or the reqular expression.
Currently I am using REFind("<a [[:space:]*[:punct:]*[:alnum:]*]>",
qLinkReview.TextBlock) where qLinkReview.TextBlock is the block of text that
I retreived from the database. The only result I am getting is 0 but I know
that all of the text blocks I am looking at have at least one link
occurance.
Once I am able to identify the links I am going to need to pull them out and
put them into an array for evaluation and possible display. I have no idea
about how to go about this. I would be greatful for any help I can get.
Also, if possible could you include explinations with any code so that I can
learn something in the process. Thanks!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256103
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4