Use the ReFindNoCase() function. Be sure to set the "returnsubexpressions" parameter to true.
=== START CODE EXAMPLE ===
<cfscript>
string
= 'This text is before the image
<img src
="images/test.jpg" width
="10" height
="10">
...and
this text
if adter the image';
vCount
= ReFindNoCase
("<img
^>
+>", string,
1,
"True");
vImg
= Mid
(string, vCount
.pos
1
, vCount
.len
1
);
</cfscript>
<cfoutput>
[COLOR=000080]<b>[/color]Position:[COLOR=000080]</b>[/color] #vCount.pos
1
#[COLOR=000080]<br>[/color]
[COLOR=000080]<b>[/color]Length:[COLOR=000080]</b>[/color] #vCount.len
1
#[COLOR=000080]<br>[/color]
[COLOR=000080]<b>[/color]Source:[COLOR=000080]</b>[/color] #HTMLEditFormat(vImg)#
</cfoutput>
=== END CODE EXAMPLE ===
Cold Fusion Manual
REFindNoCase
Description
Returns the position of the first occurrence of a regular expression in a string starting from a specified position, if the returnsubexpressions parameter is not set to True. Returns 0 if no occurrences are found. The search is case-insensitive.
Returns the position and length of the first occurrence of a regular expression in a string, if the returnsubexpressions parameter is set to True.
Category
String functions
Syntax
REFindNoCase(reg_expression, string [, start ]
[, returnsubexpressions ] )
-
tleish