Fortinet Document Library

Version:

Version:

Version:

Version:

Version:


Table of Contents

Handbook

Special characters

This section discusses the use of special characters in FortiADC scripting.

Log and debug

FortiADC supports the special characters as listed in Special characters and ways to handle them in log and debug scripts.

Special characters and ways to handle them

Character Name
~ Tilde
! Exclamation
@ At sign
# Number sign (hash)
$ Dollar sign
^ Caret
& Ampersand
* Asterisk
( Left parenthesis
) Right parenthesis
_ Underscore
+ Plus
{ Left brace
} Right brace
[ Left bracket
] Right bracket
. Full stop

?

Question mark

When written in a string, these characters look like this (between double quotes: "~!@#$^&*()_+{}[].?"

Note: The back slash (\) and the percent (%) signs are handled in a unique way in log and debug scripts. To print out %, you must use %%; to print out \, you must use \\.

HTTP data body commands

HTTP data body commands, such as find, remove, and replacesupport regular expression, which treats special characters such as (between double quote) "$^?*+.|()[]{}\" in a special way. You MUST escape these characters to demolish their special meaning. Special characters in HTTP data body commands shows how to escape these special characters.

Special characters in HTTP data body commands

To print out ... You MUST use ...
$ \\$
^ \\^
? \\?
* \\*
+ \\+
. \\.
| \\|
\ \\\\
(and) \\(and \\)
{and} \\{and \\}
[and] \\[and \\]

Note:

  • { and } are special because the script syntax looks for the matching { and }. So be sure to use them in pairs.
  • The find, remove, and replace commands use special expression. Particularly, p.ge will match the whole word page and remove and replace the whole word page. However, p*ge will remove and replace only the ge part.
  • The HTTP data body set command does not support regular expression. Only \ is special in the setcommand, and you must use \\ for it.

Special characters

This section discusses the use of special characters in FortiADC scripting.

Log and debug

FortiADC supports the special characters as listed in Special characters and ways to handle them in log and debug scripts.

Special characters and ways to handle them

Character Name
~ Tilde
! Exclamation
@ At sign
# Number sign (hash)
$ Dollar sign
^ Caret
& Ampersand
* Asterisk
( Left parenthesis
) Right parenthesis
_ Underscore
+ Plus
{ Left brace
} Right brace
[ Left bracket
] Right bracket
. Full stop

?

Question mark

When written in a string, these characters look like this (between double quotes: "~!@#$^&*()_+{}[].?"

Note: The back slash (\) and the percent (%) signs are handled in a unique way in log and debug scripts. To print out %, you must use %%; to print out \, you must use \\.

HTTP data body commands

HTTP data body commands, such as find, remove, and replacesupport regular expression, which treats special characters such as (between double quote) "$^?*+.|()[]{}\" in a special way. You MUST escape these characters to demolish their special meaning. Special characters in HTTP data body commands shows how to escape these special characters.

Special characters in HTTP data body commands

To print out ... You MUST use ...
$ \\$
^ \\^
? \\?
* \\*
+ \\+
. \\.
| \\|
\ \\\\
(and) \\(and \\)
{and} \\{and \\}
[and] \\[and \\]

Note:

  • { and } are special because the script syntax looks for the matching { and }. So be sure to use them in pairs.
  • The find, remove, and replace commands use special expression. Particularly, p.ge will match the whole word page and remove and replace the whole word page. However, p*ge will remove and replace only the ge part.
  • The HTTP data body set command does not support regular expression. Only \ is special in the setcommand, and you must use \\ for it.