[comment]: # translation:outdated

[comment]: # ({acf00dc8-acf00dc8})
# regexp.create

[comment]: # ({/acf00dc8-acf00dc8})

[comment]: # ({7f99f0b4-3c60fab5})
### Apraksts

`object regexp.create(object/array regularExpressions)`

Šī metode ļauj izveidot jaunas globālās regulārās izteiksmes.

::: noteclassic
Šī metode ir pieejama tikai *Super admin* lietotāju tipiem.
Atļaujas izsaukt šo metodi var tikt atsauktas lietotāja lomas iestatījumos. Skatiet
[Lietotāju
lomas](/manual/web_interface/frontend_sections/users/user_roles)
papildinformācijai.
:::

[comment]: # ({/7f99f0b4-3c60fab5})

[comment]: # ({fe0b3b61-f518ef9f})
### Parametri

`(object/array)` Regulārās izteiksmes, ko izveidot.

Papildus [standarta īpašībām](object) metode pieņem
šādus parametrus.

|Parametrs|[Type](/manual/api/reference_commentary#data-types)|Apraksts|
|--|--|------|
|expressions|array|[Izteiksmju](/manual/api/reference/regexp/object#expressions) opcijas.<br><br>[Parametra darbība](/manual/api/reference_commentary#parameter-behavior):<br>- *obligāts*|

[comment]: # ({/fe0b3b61-f518ef9f})

[comment]: # ({f0011f1b-f0011f1b})
### Atgrieztās vērtības

`(object)` Atgriež objektu, kas satur izveidoto regulāro
izteiksmju ID īpašībā `regexpids`.

[comment]: # ({/f0011f1b-f0011f1b})

[comment]: # ({b41637d2-b41637d2})
### Piemēri

[comment]: # ({/b41637d2-b41637d2})

[comment]: # ({87169e24-3d653b4d})
#### Jaunas globālās regulārās izteiksmes izveide.

[Pieprasījums](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "regexp.create",
    "params": {
      "name": "Storage devices for SNMP discovery",
      "test_string": "/boot",
      "expressions": [
        {
          "expression": "^(Physical memory|Virtual memory|Memory buffers|Cached memory|Swap space)$",
          "expression_type": "4",
          "case_sensitive": "1"
        }
      ]
    },
    "id": 1
}
```

Atbilde:

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

[comment]: # ({/87169e24-3d653b4d})

[comment]: # ({cf9f5f19-cf9f5f19})
### Avots

CRegexp::create() failā *ui/include/classes/api/services/CRegexp.php*.

[comment]: # ({/cf9f5f19-cf9f5f19})
