Skip to content

v1.0.2

Latest
Compare
Choose a tag to compare
@SREEHARI-M-S SREEHARI-M-S released this 18 Jul 15:25
· 8 commits to main since this release
f9eedb3

Line-watch v1.0.2 - Initial Core Release

This marks the initial public release of Line-watch, a custom command-line utility for basic regular expression matching, built entirely in Python. I'm excited to share this project, which explores fundamental concepts of pattern recognition by building an engine from the ground up, without relying on Python's built-in re module or other external regex libraries.

This version focuses on establishing the core mechanics of a regex engine, demonstrating the implementation of essential pattern matching features.

Key Features Included in this Release:

  • Custom Regex Engine: A self-contained regex matcher implemented from scratch.
  • Literal Character Matching: Finds exact character sequences.
  • Wildcard (.): Supports matching any single character.
  • Anchors (^, $): Enables matching patterns at the beginning (^) or end ($) of a line.
  • Basic Quantifiers: Implements the following repetition controls:
    • *: Matches zero or more occurrences of the preceding character.
    • +: Matches one or more occurrences of the preceding character.
    • ?: Matches zero or one occurrence of the preceding character (optional).
  • CLI Utility: A simple command-line interface to apply patterns against text.
  • Foundational Matching Logic: Employs a fundamental matching approach to determine if a pattern exists within a string.

This release represents the very first step in building a more comprehensive regex tool. It highlights the foundational logic for pattern matching.

Installation (assuming you will publish to PyPI):

pip install line-watch
# For development and running directly from source:
# git clone [https://github.com/SREEHARI-M-S/line-watch.git](https://github.com/SREEHARI-M-S/line-watch.git)
# cd line-watch
# pip install -e .

Usage Examples:
(Note: These examples assume you have updated cli.py to use argparse and the lw command as previously discussed.)

# Match literal characters
lw "abc" -s "xyzabc123"

# Match with wildcard
lw "a.c" -s "apple mac"

# Match at the start of a line
lw "^hello" -s "hello world"

# Match zero or more of 'b'
lw "ab*c" -s "ac"
lw "ab*c" -s "abc"
lw "ab*c" -s "abbbc"

What's Next?
Future updates will focus on expanding the engine's capabilities to include more advanced regex features like character classes (\d, \w), character groups ([]), custom quantifiers ({n}), and more robust error handling, building upon this initial core.

Thank you for exploring Line-watch!