Sun GlassFish Web Space Server 10.0 Secure Web Access Add-On Guide

Using Wild Cards in valuePatterns

You can use the wildcard asterisk (*) character to achieve pattern matching for rewriting.

You cannot specify just an * in the valuePatterns field. Because * indicates a match with all text, no text follows the valuePattern. Therefore, Rewriter has no text to rewrite. You must use * in conjunction with another string such as *abc. In this case, all content that follows *abc is rewritten.

Note –

An asterisk (*) can be used as a wildcard in any of the fields of the rule. However, all the fields in the rule cannot contain an *. If all fields contain a *, the rule is ignored. No error message is displayed.

You can use a * or ** along with the separation character (a semicolon or comma) that displays in the original statement to separate multiple fields. One asterisk (*) matches any field that is not to be rewritten, and two asterisks (**) to match any field that needs to be rewritten.

Using Wild Cards in valuePatterns lists some sample usages of the * wildcard.

Table 4–1 Sample Usage of * Wildcard




url1, url2, url3, url4

valuePatterns = "**, *, **, *"

url1 and url3 are rewritten because ** indicates the portion to be rewritten


valuePatterns = "*ABC"

only the portion is rewritten. Everything after *ABC needs to be rewritten.


valuePatterns = "*|*|**|*|**|*|"

dir2, dir4 and url1 are rewritten. The last field that needs to be rewritten does not have to be indicated by using **.