# -match

*noun*

say it: **“MACH”** **/mætʃ/**

A PowerShell operator that checks whether some text fits a pattern and answers True or False.

## What does **-match** do?

`-match` checks whether text fits a regular expression and answers `True` or `False`. It ignores capital letters; `-cmatch` is the case-sensitive version. When it answers `True`, the text it matched is waiting in `$Matches`.

```powershell
'paid order TM-48213' -match '\d+'   # True
'48213a' -match '^\d+$'               # False
```

## In a sentence

- “'48213a' **-match** '^\\d+$' answered False, because of the letter at the end.”
- “After **-match** answers True, $Matches holds the text it found.”

Level: Apprentice · [More PowerShell terms at this level](https://www.ask-codey.com/glossary?category=powershell&level=2)

Updated: November 10, 2026

Source: https://www.ask-codey.com/glossary/match-powershell
