Reference Template GFM Verified5 Columns · 6 Sample Rows

Regular Expression (RegEx) Syntax Reference Markdown Table Template

Comprehensive cheat sheet for regular expression metacharacters, character classes, quantifiers, anchors, and lookaround assertions.

Primary Use Case: String validation documentation, developer reference wikis, input format requirements.

Interactive Template Customizer

Edit cells, add rows, or sort — changes update the markdown live
Quick Start:
#
1
^ and $
Beginning (^) and end ($) of entire string or line
^hello$ matches "hello"
"hello world" (fails $)
2
\d and \D
Digit [0-9] (\d) or non-digit character (\D)
\d+ matches "2025"
"abc" (fails \d)
3
\w and \W
Word character [a-zA-Z0-9_] (\w) or non-word (\W)
\w+ matches "user_id"
"hello@world" (@ fails \w)
4
+ vs * vs ?
One or more (+), zero or more (*), zero or one (?)
a+ matches "aaa"
"" (empty string fails +)
5
{n,m}
\d{4} matches "2025"
"123" (requires 4 digits)
6
(?=...)
\w+(?=@) matches "user" in "user@site"
"user" without @
Flavor:
Style:
| RegEx Token       | Pattern Category | Matching Behavior                                                | Example Match                                | Non-Matching Example             |
| :---------------- | :--------------: | :--------------------------------------------------------------- | :------------------------------------------- | :------------------------------- |
| `^` and `$`       |     Anchors      | Beginning (`^`) and end (`$`) of entire string or line           | `^hello$` matches `"hello"`                  | `"hello world"` (fails `$`)      |
| `\d` and `\D`     | Character Class  | Digit `[0-9]` (`\d`) or non-digit character (`\D`)               | `\d+` matches `"2025"`                       | `"abc"` (fails `\d`)             |
| `\w` and `\W`     | Character Class  | Word character `[a-zA-Z0-9_]` (`\w`) or non-word (`\W`)          | `\w+` matches `"user_id"`                    | `"hello@world"` (`@` fails `\w`) |
| `+` vs `*` vs `?` |   Quantifiers    | One or more (`+`), zero or more (`*`), zero or one (`?`)         | `a+` matches `"aaa"`                         | `""` (empty string fails `+`)    |
| `{n,m}`           |    Quantifier    | Matches between $n$ and $m$ repetitions of preceding token       | `\d{4}` matches `"2025"`                     | `"123"` (requires 4 digits)      |
| `(?=...)`         |    Lookahead     | Positive lookahead asserting condition follows without consuming | `\w+(?=@)` matches `"user"` in `"user@site"` | `"user"` without `@`             |
Convert document (PDF, Word, PPTX) → MDConverter
Rendered Preview
GitHub Flavored Markdown style
RegEx TokenPattern CategoryMatching BehaviorExample MatchNon-Matching Example
^ and $AnchorsBeginning (^) and end ($) of entire string or line^hello$ matches "hello""hello world" (fails $)
\d and \DCharacter ClassDigit [0-9] (\d) or non-digit character (\D)\d+ matches "2025""abc" (fails \d)
\w and \WCharacter ClassWord character [a-zA-Z0-9_] (\w) or non-word (\W)\w+ matches "user_id""hello@world" (@ fails \w)
+ vs * vs ?QuantifiersOne or more (+), zero or more (*), zero or one (?)a+ matches "aaa""" (empty string fails +)
{n,m}QuantifierMatches between $n$ and $m$ repetitions of preceding token\d{4} matches "2025""123" (requires 4 digits)
(?=...)LookaheadPositive lookahead asserting condition follows without consuming\w+(?=@) matches "user" in "user@site""user" without @

Column Architecture & Alignment Specification

Carefully chosen column alignments ensure optimal visual scannability across desktop and mobile screens:

Column HeaderAlignmentDelimiter SyntaxDesign Rationale
RegEx Tokenleft:---Standard left-aligned readable text & descriptions
Pattern Categorycenter:---:Centers compact status symbols, flags, or tags
Matching Behaviorleft:---Standard left-aligned readable text & descriptions
Example Matchleft:---Standard left-aligned readable text & descriptions
Non-Matching Exampleleft:---Standard left-aligned readable text & descriptions

Pro Tips for Regular Expression (RegEx) Syntax Reference

  • Format regex patterns in inline code (`^`, `\d+`, `(?=...)`).
  • Center-align Pattern Type (Anchor, Class, Quantifier, Lookaround).
  • Provide concrete matching string examples in the example column.

How to Deploy This Table Across Platforms

GitHub README & PRs

Paste raw Markdown into README.md. Leave one blank newline above and below for GFM compliance.

Obsidian PKM Vaults

Paste directly into Live Preview mode. Use wikilinks ([[Note]]) inside cells for bidirectional linking.

Notion Workspaces

Press Enter to make a fresh empty line block, then paste. Notion auto-transforms it into a native Simple Table block.

Docusaurus & VitePress

Standard GFM tables work out of the box in modern MDX engines. You can style them via custom CSS selectors.

Raw GFM Code

| RegEx Token       | Pattern Category | Matching Behavior                                                | Example Match                                | Non-Matching Example             |
| :---------------- | :--------------: | :--------------------------------------------------------------- | :------------------------------------------- | :------------------------------- |
| `^` and `$`       |     Anchors      | Beginning (`^`) and end (`$`) of entire string or line           | `^hello$` matches `"hello"`                  | `"hello world"` (fails `$`)      |
| `\d` and `\D`     | Character Class  | Digit `[0-9]` (`\d`) or non-digit character (`\D`)               | `\d+` matches `"2025"`                       | `"abc"` (fails `\d`)             |
| `\w` and `\W`     | Character Class  | Word character `[a-zA-Z0-9_]` (`\w`) or non-word (`\W`)          | `\w+` matches `"user_id"`                    | `"hello@world"` (`@` fails `\w`) |
| `+` vs `*` vs `?` |   Quantifiers    | One or more (`+`), zero or more (`*`), zero or one (`?`)         | `a+` matches `"aaa"`                         | `""` (empty string fails `+`)    |
| `{n,m}`           |    Quantifier    | Matches between $n$ and $m$ repetitions of preceding token       | `\d{4}` matches `"2025"`                     | `"123"` (requires 4 digits)      |
| `(?=...)`         |    Lookahead     | Positive lookahead asserting condition follows without consuming | `\w+(?=@)` matches `"user"` in `"user@site"` | `"user"` without `@`             |

Standard padded style with boundary pipes matching GitHub GFM parser specifications.

Platform Support

GitHub (GFM)✓ 100% Native
GitLab (GLFM)✓ 100% Native
Obsidian Vault✓ 100% Native
Notion Workspace✓ Paste as Table
Slack & DiscordIn Code Block

Syntax Formatting Rules

  • Pipe Escaping: Use \| for text with pipe symbols.
  • Multi-line Cells: Use <br> for line breaks.
  • Monospace Text: Wrap variables or code in backticks (`key`).
  • Empty Values: Use instead of leaving cells empty.
Template Knowledge Base

Frequently Asked Questions About Regular Expression (RegEx) Syntax Reference

How can I highlight key combinations or code symbols in Regular Expression (RegEx) Syntax Reference?

Use HTML <kbd> tags for keyboard shortcuts (e.g. "<kbd>Ctrl</kbd> + <kbd>C</kbd>") or backticks for syntax tokens. This creates distinct, elevated button-like pills in GitHub and documentation themes.

Where in my repository or project documentation should I place this Regular Expression (RegEx) Syntax Reference table?

This template is specifically designed for string validation documentation, developer reference wikis, input format requirements. Place it inside your project's README.md, technical wiki, or developer portal. Always leave at least one blank newline before and after the table to ensure the GFM parser detects it properly.

Why is the "RegEx Token" column styled with left alignment?

The "RegEx Token" column functions as the primary key of this table. Setting it to left alignment establishes an anchor along the left reading margin, making it effortless for developers to scan down the list.

How do I add line breaks inside a single cell of this Regular Expression (RegEx) Syntax Reference table?

Standard Markdown table rows cannot contain literal carriage returns. To create a multi-line list inside a cell, insert HTML <br> tags (e.g. "Item 1<br>Item 2<br>Item 3"). This keeps the entire entry in a single clean row without breaking column alignments.

How do I handle optional or missing values in Regular Expression (RegEx) Syntax Reference?

Never leave table cells completely empty, as some strict Markdown parsers may collapse empty pipes. Instead, insert an em-dash ("—"), "N/A", or "None" to explicitly indicate that a value is not applicable.

Can I export this Regular Expression (RegEx) Syntax Reference table into CSV, Excel, or HTML?

Yes. In the interactive toolkit above, you can edit your data and use our integrated export tools to convert this table directly into CSV, JSON, HTML <table>, or LaTeX with a single click.