Results 1 to 4 of 4

Thread: [VB6] RegEx - Regular expression engine

Threaded View

  1. #1

    Thread Starter
    New Member nextyamb's Avatar
    Join Date
    Apr 2021
    Posts
    13

    [VB6] RegEx - Regular expression engine

    - RegEx engine compiles a regular expression string into a VM bytecode.
    - It was inspired by the article by Russ Cox.
    - Some features have been added and others have been changed.
    - Non-recursive implementation, except for lookahead.
    - This RegEx suports:

    Name:  Regex.jpg
Views: 95
Size:  23.8 KB

    1. Special characters, metacharacters:

    \t, \r, \v, \n, \f, \_ (Space)
    \+, \-, \*, \(, \) ...
    \xHH, HH is a two digit hex number

    2. Character classes:

    \d, \D, \w, \W, \s, \S

    3. Custom character classes (character classes are not allowed):

    [xyz], [^xyz], [+*/-], [_a-fA-F0-9], . (Dot)

    4. Anchors:

    ^, $

    5. Quantifiers:

    Greedy, Lazy (?) and Possessive (+)

    6. Alternation:

    A|B|AB

    7. Grouping (non-captured and captured):

    (?:...), (...)

    8. Positive and negative lookahead:

    (?=...), (?!...)

    9. Atomic grouping:

    (?>...)

    10. Backreference

    \1..\9

    11. NEW: Regex search & replace:

    (?$C regex), \i (one char back), \I (Back to start)

    Example:
    ((?$S 0S?1)\i\i | . )+
    recognizes the language: {0^n 1^n}, n>0

    12.NEW: Keep the matched text, \K, \O:

    "\K [^"]* \O"

    - Caution! This software is intended for educational and experimental purposes and has not been sufficiently tested. There are no warranties of any kind!




    - Usage: Insert a regex and a text. Then press buttons: Translate, Compile and Run
    Attached Files Attached Files
    Last edited by nextyamb; May 6th, 2026 at 06:19 AM. Reason: Software improvment

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width