Regular Expressions

Designing, parsing, and searching string parameters using Python regular expressions.

Lord1Egypt Updated 2 repo stars

File contents

Regular Expressions

Overview

Regular Expressions (Regex) define search patterns to extract or validate matching parts of texts.

When to Use This Skill

Use to extract emails, parse URLs, clean user inputs, or extract variables from raw HTML.

Quick Start (with runnable code examples)

import re

text = "Find me at akim.221992@gmail.com and also lordegypt@github.com"
# Extract all email patterns
emails = re.findall(r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}', text)
print("Emails found:", emails)

Advanced Usage

Design complex regex configurations with named lookarounds, non-capturing groups, and multi-line flag patterns.

Key References

Dependencies

  • Python Standard Library

Lord1Egypt/ai-skillforge/tree/main/skills/gemini/regular-expressions commit 59f5c188b0

Frequently asked questions

npx skillmds@latest add lord1egypt/regular-expressions