Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocs
Markdown
#markdown
#heading
#h1
#h2

Markdown Heading

Matches Markdown ATX-style headings — # through ###### followed by text. Captures both the level (number of #) and the heading text.

Markdown parsersTable of contents generatorsDocumentation tools
/
/
Test String
4 matches
^^^ — start of string (or line in multiline mode)
(…)Group #1Capturing group — captures matched text for reuse or extraction
#{1,6}#'#' — literal character — repeated between 1 and 6 times · {1,6} — between 1 and 6 times
\s+space\s — whitespace (space, tab, newline…) — repeated one or more times (greedy) · + — one or more times (greedy)
(…)Group #2Capturing group — captures matched text for reuse or extraction
.+.. — matches any character except newline (unless 's' flag is set) — repeated one or more times (greedy) · + — one or more times (greedy)
$$$ — end of string (or line in multiline mode)
Pattern: 17 charsInput: 64 chars
100% client-side · private

Valid Examples

  • # H1 Title
  • ## Section Two
  • ### Subsection
  • ###### Smallest Heading

Invalid Examples

  • #NoSpace
  • ####### Too many hashes
  • Not a heading