Steve,
Try
<cfset StringToSearch  = "bla bla [code] this is stuff [/code] bla bla">

<cfset arrayMatch = REFindNoCase("(?:\[code\])(.*)(?:\[/code\])",
                                 StringToSearch,
                                 1,
                                 "True")>

<cfset searchResult = Mid(StringToSearch,
                          arrayMatch.pos[2],
                          arrayMatch.len[2])>

<cfoutput>#searchResult#</cfoutput>

Also, for a really nice tool (free) for playing around with regexp:
http://www.weitz.de/regex-coach/

Cheers
Tony Stratford

Steve Onnis wrote:

Hey guys

Can anyone help me here?

REFindNoCase("(?=(\[code\]))(.*?)(?=(\[\/code\]))",tmpContent,1,true);

I have a string that could for example look like this

[code]
hello
[/code]

I am trying to extract "hello" from the string.

I can do it no probs but it includes the [code] and [/code] strings, which
if i can aviod it i would like to.

Now according to the docs, prefixing the group with ?= will look for it but
isnt suposed to return it as part of the results.  So (?=(\[code\])) should
not be returning [code] in my string, but is is.  The strange this is aswell
that the (?=(\[\/code\])) is actually working, as in it is not being
included in the string.

So at the moment I am ending up with :

[code]
hello

Any ideas here?  From what I can see this SHOULD work, but its not :(


Regards Steve Onnis




--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]

MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia
http://www.mxdu.com/ + 24-25 February, 2004

Reply via email to