-
-
Advanced policy expressions: Working with dates, times, and numbers
-
Advanced policy expressions: Parsing HTTP, TCP, and UDP data
-
Advanced policy expressions: IP and MAC Addresses, Throughput, VLAN IDs
-
Regular expressions
-
-
This content has been machine translated dynamically.
Dieser Inhalt ist eine maschinelle Übersetzung, die dynamisch erstellt wurde. (Haftungsausschluss)
Cet article a été traduit automatiquement de manière dynamique. (Clause de non responsabilité)
Este artículo lo ha traducido una máquina de forma dinámica. (Aviso legal)
此内容已经过机器动态翻译。 放弃
このコンテンツは動的に機械翻訳されています。免責事項
이 콘텐츠는 동적으로 기계 번역되었습니다. 책임 부인
Este texto foi traduzido automaticamente. (Aviso legal)
Questo contenuto è stato tradotto dinamicamente con traduzione automatica.(Esclusione di responsabilità))
This article has been machine translated.
Dieser Artikel wurde maschinell übersetzt. (Haftungsausschluss)
Ce article a été traduit automatiquement. (Clause de non responsabilité)
Este artículo ha sido traducido automáticamente. (Aviso legal)
この記事は機械翻訳されています.免責事項
이 기사는 기계 번역되었습니다.책임 부인
Este artigo foi traduzido automaticamente.(Aviso legal)
这篇文章已经过机器翻译.放弃
Questo articolo è stato tradotto automaticamente.(Esclusione di responsabilità))
Translation failed!
Regular expressions
When you want to perform string matching operations that are more complex than the operations that you perform with the CONTAINS("<string>"
) or EQ("<string>"
) operators, you use regular expressions. The policy infrastructure on the Citrix® NetScaler® appliance includes operators to which you can pass regular expressions as arguments for text matching. The names of the operators that work with regular expressions include the string REGEX. The regular expressions that you pass as arguments must conform to the regular expression syntax that is described in "<http://www.pcre.org/pcre.txt>."
You can learn more about regular expressions at "<http://www.regular-expressions.info/quickstart.html>"
and at "<http://www.silverstones.com/thebat/Regex.html>."
The target text for an operator that works with regular expressions can be either text or the value of an HTTP header. Following is the format of a Advanced policy expression that uses a regular expression operator to operate on text:
<text>.<regex_operator>(re<delimiter><regex_pattern><delimiter>)
The string <text>
represents the Advanced policy expression prefix that identifies a text string in a packet (for example, HTTP.REQ.URL). The string <regex_operator>
represents the regular expression operator. The regular expression always begins with the string re. A pair of matching delimiters, represented by <delimiter>
, enclose the string <regex_pattern>
, which represents the regular expression.
The following example expression checks whether the URL in an HTTP packet contains the string *.jpeg
(where *
is a wildcard) and returns a Boolean TRUE or FALSE to indicate the result. The regular expression is enclosed within a pair of slash marks (/), which act as delimiters.
http.req.url.regex_match(re/.<asterisk>\.jpeg/)
Regular expression operators can be combined to define or refine the scope of a search. For example, <text>.AFTER_REGEX(reregex_pattern1).BEFORE_REGEX(reregex_pattern2)
specifies that the target for string matching is the text between the patterns regex_pattern1 and regex_pattern2. You can use a text operator on the scope that is defined by the regular expression operators. For example, you can use the CONTAINS("<string>"
) operator to check whether the defined scope contains the string abc:
<text>.AFTER_REGEX(re/regex_pattern1).BEFORE_REGEX(re/regex_pattern2/).CONTAINS("abc")
Note
The process of evaluating a regular expression inherently takes more time than that for an operator such as CONTAINS (
"<string>"
) or EQ("<string>"
), which work with simple string arguments. You should use regular expressions only if your requirement is beyond the scope of other operators.
Share
Share
In this article
This Preview product documentation is Cloud Software Group Confidential.
You agree to hold this documentation confidential pursuant to the terms of your Cloud Software Group Beta/Tech Preview Agreement.
The development, release and timing of any features or functionality described in the Preview documentation remains at our sole discretion and are subject to change without notice or consultation.
The documentation is for informational purposes only and is not a commitment, promise or legal obligation to deliver any material, code or functionality and should not be relied upon in making Cloud Software Group product purchase decisions.
If you do not agree, select I DO NOT AGREE to exit.