
Securing ColdFusion • Chapter 10 423
This code sample uses regular expressions to detect if the pattern we
want exists.The REFind function says to use regular expressions with
the first attribute being the expression and the second being the string
to check.The regular expression here says to look for a pipe followed by
one or more characters that are not pipes, followed by another pipe. If a
single pipe exists in the string, no error will be thrown. If two pipes
exist one after the other, no error will be thrown either.This is a check,
but it can easily enough be used as a “sweeper.”This would be done as
shown in Figure 10.24.
Figure 10.24 Using Regular ...