Справочник Пользователя для Citrix Systems 9.2
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
Operations That Apply Regular Expressions to Text and HTTP Headers
Regular Expression Operation
Description
text.BEFORE_REGEX(regular
expression)
Selects text that precedes the string that matches
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 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".
from "text/plain".
http.res.header("content-
type").before_regex(re#/#)
text.AFTER_REGEX(regular
expression)
Selects text that follows the string that matches the
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.
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":
"myExample":
http.req.header("etag").after_
regex(re/my/)
regex(re/my/)
text.REGEX_SELECT(regular
expression)
Selects a string that matches the regular expression
argument. If the regular expression does not match
the target, a text object of length of 0 is returned.
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:
CACHE-9.0: 90" from a Via header:
http.req.header("via").regex_
select(re!NS-CACHE-
\d\.\d:\s*\d{1,3}!)