I know it looks nasty, but this is what I came up with:

<CFMODULE[[:space:]]+[^>]+textline\.cfm[^>[:space:]]*([[:space:]]+[^M][^A=]?
[^X=]?[^H=]?[^S=]?[^I=]?[^Z=]?[^E=]?[_[:alnum:]]*=("[^"]*"|[^>[:space:]]*))+
[[:space:]]*>

I used the following test cases:

<CFMODULE TEMPLATE="textline.cfm" SOMETHING="foo">
<CFMODULE TEMPLATE="textline.cfm" SOMETHING="foo" MAXHSIZE="bar" BAZ="QUUX">
<CFMODULE TEMPLATE="textline.cfm" O=1>
<CFMODULE textline.cfm MAXHSIZE="bar">
<CFMODULE TEMPLATE="textline.cfm" A_B_C=123>
<CFMODULE textline.cfm MAXHSIZE=2>

It correctly found the 3 lines that do *not* have the MAXHSIZE attribute.

HTH,
-R


-----Original Message-----
From: Harry Klein [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 12:29
To: CF-Talk
Subject: RE: Regular Expression


Thanks for your help,

i think my explanation was really bad.
I would use the same code as you, but my problem is that i want to find
all <cfmodule> tags with no attribute MAXHSIZE.
The attribute is not deprecated but required.

Sorry for the inconveniance.

Harry

> -----Original Message-----
> From: Gyrus [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 04, 2001 5:10 PM
> To: CF-Talk
> Subject: Re: Regular Expression
>
>
> > In plain english: I try to find all <cfmodule> tags. After
> <cfmodule are
> > some characters, then textline.cfm then again some characters.
> > The expression MAXHSIZE should not be found in the part between
> > textline.cfm to >
> >
> > Again: I try to find wrong <cfmodule> calls with a
> deprecated attribute
> > (MAXHSIZE).
>
> Slightly confusing explanation, but assume you want to match those
> tags where MAXHSIZE *does* exist, to identify invalid tags. Try
>
> <cfmodule [^>]+textline.cfm[^>]+MAXHSIZE[^>]+>
>
> Not 100% on this, but seems to work with basic test. The core
> trick is "[^>]+" (match one or more characters that aren't ">" -
> keeps the match inside the tag bounds.
>
> hth,
>
> - Gyrus
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to