Skip to content
Back to skills

Matches

ASecurity

Check if text matches regex pattern or contains substring

  • 10 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added June 6, 2026
ai-agents

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add bdambrosio/Cognitive_workbench --skill matches --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Matches?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Matches
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bdambrosio-matches/badge)](https://www.skillsdirectory.com/skills/bdambrosio-matches)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: matches
description: Check if text matches regex pattern or contains substring
type: prompt_augmentation
examples:
  - '{"type":"if","condition":{"type":"tool_condition","tool":"matches","target":"$text","pattern":"error"},"then":[...]}'
---

# Contains Pattern

Check whether text contains a pattern or substring.

## Purpose

- Enable conditional logic based on content
- Pattern matching for flow control
- Content validation
- Simple filtering

## Input Format

Accepts a Note containing text to check.

## Parameters

**Required:**
- **pattern** - Text string or regex pattern to match

**Optional:**
- **match_type** - "substring" (default), "regex", or "exact"

## Output Format

Returns a Note containing:
- "true" if pattern found
- "false" if pattern not found

## Usage Examples

**Simple substring check:**
```json
{"type":"matches","target":"$text","pattern":"error","out":"$has_error"}
```

**Regex pattern match:**
```json
{"type":"matches","target":"$email","pattern":"^[a-z]+@example\\.com$","match_type":"regex","out":"$is_valid_email"}
```

**Exact match:**
```json
{"type":"matches","target":"$status","pattern":"complete","match_type":"exact","out":"$is_complete"}
```

## Match Types

- **substring**: Pattern appears anywhere in text (case-sensitive)
- **regex**: Full regex pattern matching
- **exact**: Entire text must exactly match pattern

## Guidelines

- Case-sensitive by default
- Returns boolean as text ("true"/"false")
- Use for conditional logic in plans
- Combine with other conditionals as needed

## Examples

**Substring (default):**
```
Text: "Error occurred in module X"
Pattern: "Error"
Result: true
```

**Regex:**
```
Text: "user@example.com"
Pattern: ".*@example\\.com$"
Result: true
```

**Exact:**
```
Text: "done"
Pattern: "done"
Result: true

Text: "almost done"
Pattern: "done"
Result: false
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.