Regex help command with comprehensive reference #47

Closed
opened 2026-02-15 04:44:38 +03:00 by NiXTheDev · 2 comments
NiXTheDev commented 2026-02-15 04:44:38 +03:00 (Migrated from github.com)

Description

Add comprehensive regex syntax reference command with support for individual tokens and constructs.

Use Case

Users often forget regex syntax. Instead of leaving Telegram to search docs, they can get instant help.

Implementation Plan

  1. Create regexhelp.ts module

    • Static help content organized by category
    • Paginated output (respect 4096 char limit)
    • Clean formatting without emojis
  2. Help categories

    • /regexhelp tokens - \d, \w, \s, \D, \W, \S, ., ^, $
    • /regexhelp quantifiers - *, +, ?, {n}, {n,}, {n,m}
    • /regexhelp groups - (), (?:), (?=), (?!), (?<=), (?<!)
    • /regexhelp classes - [], [^], ranges [a-z]
    • /regexhelp escapes - \., \*, \+, \, \n, \t, etc.
    • /regexhelp flags - g, i, m, s, u, y, p
    • /regexhelp anchors - ^, $, \b, \B
  3. Output format

    Regex Tokens Reference
    
    \\d  - Any digit (0-9)
    \\D  - Any non-digit
    \\w  - Any word character [a-zA-Z0-9_]
    \\W  - Any non-word character
    \\s  - Any whitespace
    \\S  - Any non-whitespace
    .   - Any character except newline
    
    Use /regexhelp <category> for specific topics
    Categories: tokens, quantifiers, groups, classes, escapes, flags, anchors
    
  4. Integration

    • Register /regexhelp command
    • Optional category parameter
    • Default to overview if no category specified

Acceptance Criteria

  • All regex constructs documented
  • Categories work as sub-commands
  • Output fits within message limits
  • No emojis, clean text only
  • Easy to navigate

Part of Epic #38

## Description Add comprehensive regex syntax reference command with support for individual tokens and constructs. ## Use Case Users often forget regex syntax. Instead of leaving Telegram to search docs, they can get instant help. ## Implementation Plan 1. **Create regexhelp.ts module** - Static help content organized by category - Paginated output (respect 4096 char limit) - Clean formatting without emojis 2. **Help categories** - /regexhelp tokens - \\d, \\w, \\s, \\D, \\W, \\S, ., ^, $ - /regexhelp quantifiers - \*, +, ?, {n}, {n,}, {n,m} - /regexhelp groups - (), (?:), (?=), (?!), (?<=), (?<!) - /regexhelp classes - [], [^], ranges [a-z] - /regexhelp escapes - \\., \\\*, \\+, \\, \\n, \\t, etc. - /regexhelp flags - g, i, m, s, u, y, p - /regexhelp anchors - ^, $, \\b, \\B 3. **Output format** ``` Regex Tokens Reference \\d - Any digit (0-9) \\D - Any non-digit \\w - Any word character [a-zA-Z0-9_] \\W - Any non-word character \\s - Any whitespace \\S - Any non-whitespace . - Any character except newline Use /regexhelp <category> for specific topics Categories: tokens, quantifiers, groups, classes, escapes, flags, anchors ``` 4. **Integration** - Register /regexhelp command - Optional category parameter - Default to overview if no category specified ## Acceptance Criteria - [ ] All regex constructs documented - [ ] Categories work as sub-commands - [ ] Output fits within message limits - [ ] No emojis, clean text only - [ ] Easy to navigate ## Related Part of Epic #38
FroogalTheDragon commented 2026-02-15 23:16:43 +03:00 (Migrated from github.com)

This one sounds fun, and at my skill level!

This one sounds fun, and at my skill level!
FroogalTheDragon commented 2026-02-16 01:18:31 +03:00 (Migrated from github.com)

What do you think about /regexhelp starting a conversation with a custom keyboard with say the help categories listed for the user to select? Then when the user selects a help category, another custom keyboard with all of the options for that help category. For example: if the user selected tokens then another custom keyboard would come up with all of the tokens available and then whatever token the user selects the bot can display info about that token.

Or did you want to stick the the format /regexhelp [HELP QUERY]?

What do you think about `/regexhelp` starting a conversation with a custom keyboard with say the help categories listed for the user to select? Then when the user selects a help category, another custom keyboard with all of the options for that help category. For example: if the user selected tokens then another custom keyboard would come up with all of the tokens available and then whatever token the user selects the bot can display info about that token. Or did you want to stick the the format `/regexhelp [HELP QUERY]`?
Sign in to join this conversation.
No description provided.