# danog\MadelineProto\EventHandler\Filter\FilterRegex: Allow only messages or button queries matching the specified regex.

[Back to index](../../../../index.html)

> Author: Daniil Gentili <daniil@daniil.it>  
  

Allow only messages or button queries matching the specified regex.  




## Method list:
* [`__construct(non-empty-string $regex, int-mask<0, 256, 512> $flags = 0, int $offset = 0)`](#__construct)
* [`apply(\danog\MadelineProto\EventHandler\Update $update): bool`](#apply)
* [`initialize(\danog\MadelineProto\EventHandler $API): \danog\MadelineProto\EventHandler\Filter\Filter`](#initialize)
* [`fromReflectionType(\ReflectionType $type): \danog\MadelineProto\EventHandler\Filter\Filter`](#fromReflectionType)

## Methods:
### <a name="__construct"></a> `__construct(non-empty-string $regex, int-mask<0, 256, 512> $flags = 0, int $offset = 0)`




Parameters:

* `$regex`: `non-empty-string`   
* `$flags`: `int-mask<0, 256, 512>`   
* `$offset`: `int`   


#### See also: 
* `non-empty-string`
* `int-mask`




### <a name="apply"></a> `apply(\danog\MadelineProto\EventHandler\Update $update): bool`




Parameters:

* `$update`: `\danog\MadelineProto\EventHandler\Update`   


#### See also: 
* [`\danog\MadelineProto\EventHandler\Update`: Represents a generic update.](../../../../danog/MadelineProto/EventHandler/Update.html)




### <a name="initialize"></a> `initialize(\danog\MadelineProto\EventHandler $API): \danog\MadelineProto\EventHandler\Filter\Filter`

Run some initialization logic, optionally returning a new filter to replace the current one.


Parameters:

* `$API`: `\danog\MadelineProto\EventHandler`   


#### See also: 
* [`\danog\MadelineProto\EventHandler`: Event handler.](../../../../danog/MadelineProto/EventHandler.html)




### <a name="fromReflectionType"></a> `fromReflectionType(\ReflectionType $type): \danog\MadelineProto\EventHandler\Filter\Filter`




Parameters:

* `$type`: `\ReflectionType`   


#### See also: 
* `\ReflectionType`




---
Generated by [danog/phpdoc](https://phpdoc.daniil.it)
