166 Citrix NetScaler Policy Configuration and Reference Guide

The following table describes operations that use regular expressions.

Operations That Apply Regular Expressions to Text and HTTP Headers

Regular Expression Operation

Description

 

 

text.BEFORE_REGEX(regular

Selects text that precedes the string that matches

expression)

the regular expression argument. If the regular

 

expression does not match any data in the target,

 

the expression returns a text object of length of 0.

 

The following expression selects the string "text"

 

from "text/plain".

 

http.res.header("content-

 

type").before_regex(re#/#)

text.AFTER_REGEX(regular

Selects text that follows the string that matches the

expression)

regular expression argument. If the regular

 

expression does not match any text in the target,

 

the expression returns a text object of length of 0.

 

The following expression extracts "Example" from

 

"myExample":

 

http.req.header("etag").after_

 

regex(re/my/)

text.REGEX_SELECT(regular

Selects a string that matches the regular expression

expression)

argument. If the regular expression does not match

 

the target, a text object of length of 0 is returned.

 

The following example extracts the string "NS-

 

CACHE-9.0: 90" from a Via header:

 

http.req.header("via").regex_

 

select(re!NS-CACHE-

 

\d\.\d:\s*\d{1,3}!)

Page 180
Image 180
Citrix Systems 9.2 manual Selects text that precedes the string that matches, Regular expression argument. If the regular