nim-regex

repository·master·Indexed 42 days ago

https://github.com/nitely/nim-regex

A Nim library for parsing, compiling, and executing regular expressions with PCRE syntax and semantics. It supports both runtime and compile-time execution, guarantees linear match time, and provides Unicode level-1 support.

Tokens
294
Snippets
2
Records
3
Agent score
4%

What's inside nim-regex

  1. Overview of nim-regex features

    master

    The regex library provides tools for parsing, compiling, and executing regular expressions. Key capabilities include:

    • Performance: Match time is linear relative to the input string length.
    • Safety: Supports compile-time syntax validation and descriptive error messages.
    • Execution Modes: Supports both runtime execution and Nim VM (compile-time) execution.
    • Compatibility: Follows PCRE syntax and semantics and provides Unicode level-1 support.
  2. Check regex NFA structures using DOT files

    master

    If you need to debug or visualize the internal Non-deterministic Finite Automaton (NFA) of a regex, you can generate DOT files.

    1. Compile your Nim code with the flag -d:regexDotDir:<directory>. Using . will output files to the current directory.
    2. Open the resulting .dot files in a tool like Graphviz Online to view the regex structure visually.

    Note: This requires Nim version 1.2 or higher.

    nim c -d:regexDotDir:. your_file.nim