Skip to main content
This topic has been closed for replies.

2 replies

October 3, 2012

How would you negate specific characters then? In my cftextarea I don't want to allow single or double quotes. In the cftextarea tag I set validate="regular_expression" pattern="([\'\&\*\#\"]*$)" but I get an error because CF thinks I'm closing the pattern parameter before the closing ] bracket. I've tried to pass pattern as a literal by using single quotes instead and that didn't work either.

A workaround example would be greatly appreciated.

WolfShade
Legend
October 3, 2012

I don't know about CF RegEx, but I think in JavaScript RegEx, certain characters within [ and ] don't need to be escaped.

^_^

October 3, 2012

Thanks WolfShade. I think I'm going to try a different approach and sanitize the field on the submit page and strip the quotes.

Participating Frequently
May 15, 2012

Shouldn't this return 6? It is returning 1 for me. Is this broken or am I doing something incorrectly?? Changing this to reMatchNoCase returns an array of each lowercase letter, so that is why it returns 1, but I think that is a bug.

foo = "this Test";

writeDump(reFindNoCase("[[:upper:]]",foo));

Participating Frequently
May 15, 2012

DUH, reFindnocase is going to find letters and ignore case! Copy/paste foils me again! Sorry!!