Regular Expressions and Restrictions

Regular Expression Restrictions for FusionReactor use the Java 1.4 RegEx language. For more technical information on Regular Expressions please refer to the online Java documentation

Quick Overview of RegEx Special Characters

.

matches any character

\d

matches any digit

\w

matches any word character [a-zA-Z_0-9]

\s

matches any whitespace character

[]

contents define a character class

[abc]

matches a, b or c

[^abc]

matches anything except a, b or c

|

alternation operator ('or')

X|Y

matches X or Y

X?

matches X once, or not at all

X*

matches X zero or more times (matching as much as possible)

X*?

matches X zero or more times (matching as little as possible)

X+

matches X one or more times

()

grouping characters

^

start of line

$

end of line

Example Restrictions

/myfolder/myfile.cfm

This will match any URL which contains "/myfolder/myfile.cfm"

/myfolder/(.*)

This will match anything within "myfolder"

/myfile\.cfm

This will match any files named myfile.cfm which are inside a directory.

\.((cfm)|(jsp))

This will match any .cfm or .jsp file.

/myfile\.cfm/?(.*)mode=add

This expects parameter checking to be enabled. It will match any file named myfile.cfm which has the string "mode=add" as part of it's parameters. (Note: This will also match mymode=add.)

/batch[0-9].cfm

This will match files names batch0.cfm, batch1.cfm ... batch9.cfm