# Match Text with a Regular Expression

**Use case:** 

Match status lines with a named regular expression and save every match in an Apify dataset.

## Input

```json
{
  "target": "texts",
  "texts": [
    "Status: ERROR\nstatus: warning\nStatus: OK"
  ],
  "datasetTextField": "text",
  "patterns": [
    {
      "name": "statusLines",
      "expression": "^status:\\s*(?<status>error|warning|ok)$"
    }
  ],
  "matchMode": "all",
  "flags": [
    "IGNORECASE",
    "MULTILINE"
  ]
}
```

## Output

```json
{
  "text": {
    "label": "Text",
    "format": "string"
  },
  "matchCount": {
    "label": "Match count",
    "format": "integer"
  },
  "matchesByPattern": {
    "label": "Matches by pattern",
    "format": "object"
  }
}
```

## About this Actor

This example demonstrates how to use [Regex Helper](https://apify.com/maximedupre/regex-helper) with a specific input configuration. Visit the [Actor detail page](https://apify.com/maximedupre/regex-helper) to learn more, explore other use cases, and run it yourself.