So the JDK uses Perl which is why my
lookbehind worked in my class, and then CF uses a
proprietary version of Perl's implementation.
I wouldn't say proprietary, I'd say incomplete. Perl's Regular
Expressions are extremely powerful and complex, from what I've seen. I
get lost pretty quickly
with how you structure your
pattern, you can mimic the [negative/positive] lookbehind function.
-Original Message-
From: Munson, Jacob [mailto:[EMAIL PROTECTED]
Sent: Friday, January 06, 2006 6:04 PM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
I just looked in my
: Thursday, January 05, 2006 6:16 PM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
Steve,
That causes an error. What's the '' in between the '?' and '!'
supposed to do (a typo?)
Ian,
Try this:
cfset MyString = /organization title
cfset MyResult =
ReFind
:[EMAIL PROTECTED]
Sent: Friday, January 06, 2006 12:07 PM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
Ok, ok, so I didn't actually try an example in CF :)
CF must use a different RegEx engine than what I'm used to
using. The ?! is
negative lookbehind
], matchStruct.len[1]);
/cfscript
cfdump var=#trueMatch#
-Original Message-
From: Steve Brownlee [mailto:[EMAIL PROTECTED]
Sent: Friday, January 06, 2006 12:07 PM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
Ok, ok, so I didn't actually try an example in CF
with
it. Fortunately for me, I learned regex in Perl before I tried them in
CF. :-D
-Original Message-
From: Steve Brownlee [mailto:[EMAIL PROTECTED]
Sent: Friday, January 06, 2006 10:38 AM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
Ok, this is strange. That RegEx
Scott and Steve,
This is strange, I just looked in my Perl docs; Perl /does/ support
look behind:
(?=...) zero width positive look behind
(?!...) zero width negative look behind
I wonder why CF doesn't support this? Maybe because it's totally
possible to do it other ways (positive look ahead
I just looked in my Advanced Macromedia ColdFusion MX 7 Application
Development book (what a title! ;)), written by Ben Forta and a bunch
of other folks, and this paragraph is very on topic:
...these additions make ColdFusion's RegEx support much more powerful,
and much closer to the way regular
I am a bit rusty, but maybe something along this line:
(/organization)(?=!\s*title)
This might not be the correct syntax, but I mean to say find /organization
if only there is a negative look ahead for the expression \s*title.
This might help spark some other people's better answers.
-ben
Just one correction
(/organization)(?!\s*title)
-Original Message-
From: Ben Nadel [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 05, 2006 5:23 PM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
I am a bit rusty, but maybe something along this line
Message-
From: Steve Brownlee [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 05, 2006 3:27 PM
To: CF-Talk
Subject: RE: Regex ex question. How to match NOT this string.
Just one correction
(/organization)(?!\s*title)
-Original Message-
From: Ben Nadel [mailto:[EMAIL
11 matches
Mail list logo