Chapter 4 Advanced Expressions: Evaluating Text 87

Basic Operations on Text

Basic Text Operation

Description

 

 

text.EQ("string")

Returns a Boolean TRUE value if the target is an exact

 

match with string.

 

For example, the following expression returns a

 

Boolean TRUE for a URL with a host name of

 

“myhostabc”:

 

http.req.url.hostname.eq("myhostabc")

text.

Returns a Boolean TRUE value if the target begins

STARTSWITH("string")

with string.

 

For example, the following expression returns a

 

Boolean TRUE for a URL with a host name of

 

“myhostabc”:

 

http.req.url.hostname.

 

startswith("myhost")

text.ENDSWITH("string")

Returns a Boolean TRUE value if the target ends with

 

string.

 

For example, the following expression returns a

 

Boolean TRUE for a URL with a host name of

 

“myhostabc”:

 

http.req.url.hostname.endswith("abc")

Operations for Calculating the Length of a String

The following operation returns a numeric value that shows the number of characters (not bytes) of a string:

text.LENGTH

For example, you may want to identify request URLs that exceed a particular length. Following is the expression that implements this example:

HTTP.REQ.URL.LENGTH < 500

After taking a count of the characters or elements in a string, you can apply numeric operations to them. For more information, see “Advanced Expressions: Working with Dates, Times, and Numbers,” on page 95.

Operations for Controlling Case Sensitivity

The following operation turns case sensitivity on or off for an expression.

Operations on Case Sensitivity of Text

Case Operation

Description

 

 

text.SET_TEXT_

This operation turns case sensitivity on or off

MODE(IGNORECASE

for all text operations.

NOIGNORECASE)

 

Page 101
Image 101
Citrix Systems 9.2 manual Operations for Calculating the Length of a String, Operations for Controlling Case Sensitivity