Created on
08-16-2020
01:43 PM
Edited on
12-05-2025
07:53 AM
By
Jean-Philippe_P
Description
This article describes how to insert the question mark into regular expressions.
By default, the symbol '?' is used to show the help menu.
But sometimes, it is required inside the regular expressions, as the question mark makes the preceding token in the regular expression optional.
Scope
FortiGate.
Solution
As the symbol of a question mark is reserved to help menu, it will be impossible to copy-paste or type this symbol into some expressions.
Here is the simple snippet from DLP dictionary:
config dlp dictionary
edit "default"
config entries
edit 1
set type regex
set pattern "(?s:(\\d{10}.*))"
next
end
next
end
To be able to insert the question mark, the following options are available:
Note: In batch mode, it is not possible to run the 'show' command to check the existing configuration, or press 'Tab' to auto-complete sub-commands, or press '?' to list all available commands. It is important to know the exact commands to run. This method works well for bulk configuration (copy and paste).
Related article:
Technical Tip: How to enter '?' (Question mark character) in the FortiGate CLI
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.