Created on 08-16-2020 01:43 PM Edited on 11-23-2021 08:08 AM By Anonymous
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 sometime it is required inside the regular expressions.
As the question mark makes the preceding token in the regular expression optional.
Solution
As the symbol of question mark is reserved to help menu, it will be impossible to copy-past or type this symbol into some expressions.
Here is the simple snippet from DLP sensor:
# config dlp sensor
edit "default"
set comment "Default sensor."
# config filter
edit 1
set proto smtp pop3 imap http-post
set filter-by regexp
set regexp "(?s:(\\d{10}.*))"
set action block
next
end
next
end
To be able to insert this kind of symbols, open the Putty client and press 'Ctrl-V' first then input '?'.
Note: it will not allow to do it form the WebGUI CLI available on management page.
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 2024 Fortinet, Inc. All Rights Reserved.