Это перевод страницы документации с английского языка. Помогите нам сделать его лучше.

regexp.update

Description

object regexp.update(object/array regularExpressions)

This method allows to update existing global regular expressions.

This method is only available to Super admin user types. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object/array) Regular expression properties to be updated.

The regexpid property must be defined for each object, all other properties are optional. Only the passed properties will be updated, all others will remain unchanged.

Additionally to the standard properties, the method accepts the following parameters.

Parameter Type Description
expressions array Expressions options.

Возвращаемые значения

(объект) Возвращает объект, который содержит ID обновленных регулярных выражений, указанных в свойствеregexpids.

Примеры

Обновление глобального регулярного выражения для обнаружения файловых систем.

Запрос:

{
           "jsonrpc": "2.0",
           "method": "regexp.update",
           "params": {
             "regexpid": "1",
             "name": "File systems for discovery",
             "test_string": "",
             "expressions": [
               {
                 "expression": "^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|zfs)$",
                 "expression_type": "3",
                 "exp_delimiter": ",",
                 "case_sensitive": "0"
               },
               {
                 "expression": "^(ntfs|fat32|fat16)$",
                 "expression_type": "3",
                 "exp_delimiter": ",",
                 "case_sensitive": "0"
               }
             ]
           },
           "auth": "700ca65537074ec963db7efabda78259",
           "id": 1
       }

Ответ:

{
           "jsonrpc": "2.0",
           "result": {
               "regexpids": [
                   "1"
               ]
           },
           "id": 1
       }

Исходный код

CRegexp::update() в ui/include/classes/api/services/CRegexp.php.