At a guess, it's because you're grabbing (potentially) the whole string.

If you are using MX+ you should use a non-greedy match.  I'd combine the two
char classes into one, which will allow you to drop all the parens (which
are needlessly creating backreferences).

You'll end up with something like
\[[[:print:][:space:]]*?\]
for your regex.

For a deeper discussion, feel free to bring it up on
http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21
The HoF RegEx list.

HTH.


--  Ben Doom
    Programmer & General Lackey
    Moonbow Software, Inc

: -----Original Message-----
: From: Brook Davies [mailto:[EMAIL PROTECTED]
: Sent: Thursday, August 21, 2003 3:03 PM
: To: CF-Talk
: Subject: Quick Reg Ex Question
:
:
: <cfset z=REfindnocase("(\[)([[:print:][:space:]])*(\])",str,startpos)>
:
: Using CF4.5 this regex worked fine on all lengths of strings. Moving to
: CFMX this generated the infamous "null null" errors until the
: string being
: parsed was shortened to 12,500 chars. After the redsky update, this code
: again started to bug out and the length of the string being parsed had to
: be shortened again to 8300 characters. With 6.1 I get an error that says
: "java.lang.StackOverflowError" and nothing more, no stack trace.
:
: Is this a problem with my regex?
:
: What the regex does, is find any value inside square brackets like [First
: Name] or [First
: Name].
:
: Maybe there is some way to improve the regex so these errors do not keep
: happening.
:
: Brook
:
:
: 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to