Personally I don't think this is possible with regexs, but I'd love to be
corrected. It would need to be able to look for an even number of quotes
followed by a greater than sign.

This would also allow the valid statement <cfset test="part 2" & "> part 1"> to
be distinguished from the invalid statement <cfset test="invalid " ">.

David

Seth Petry-Johnson wrote:
> 
> I am trying to build a regular expression to test for valid CFSET statements
> in a block of text.  I have it working with one small issue:  if a ">"
> character appears on the right hand side of the equals sign, such as in
> 
> <CFSET test = "This is a test with a > sign">
> 
> then the regexp fails to match the whole string.  I am only concerned with
> statements that set local variables which is why the regexp doesn't take
> variable scope into consideration. Here is what I have right now:
> 
> <!--- This regexp should match any local CFSET statement
>     with optional spaces on either  side of the equals sign --->
> <CFSET reCFSET = "(<CFSET [a-zA-Z0-9_]+( )?=( )?([[:Graph:]]|( ))+>)">
> 
> Can anyone give me some pointers as to how I can modify this to support the
> ">" sign if it appears inside single or double quotes on the right hand side
> of the equals sign?
> 
> Thanks in advance,
> Seth Petry-Johnson
> Argo Enterprise and Associates
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to