> For the complete documentation index, see [llms.txt](https://docs.r.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.r.xyz/glider-ide/api/contracts/contracts.with_event_regex.md).

# Contracts.with\_event\_regex()

Adds a filter to get contracts that have an event whose name matches the given regex.

`with_event_regex(regex: str) ->` [`Contracts`](/glider-ide/api/contracts.md)

## Query Example

```python
from glider import *

def query():
  contracts = Contracts().with_event_regex('^change.*').exec(1)
  events = contracts[0].events()
  for event in events:
    print(event.signature)

  return contracts
```

## Output Example

<figure><img src="https://2237101709-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDX4Ojc4j1ef51TUAtYOx%2Fuploads%2F25neJupSetRNsPVRvSXs%2Fimage.png?alt=media&amp;token=7d5566cc-cba5-4883-843b-b97e9ec76675" alt=""><figcaption></figcaption></figure>
