Add regex match functions.#22
Draft
san-rizz-777 wants to merge 2 commits intoProgramming-Club-Org:devfrom
Draft
Conversation
be02c82 to
32f2677
Compare
Member
|
I have merged @AbhishekRai456 's PR, please modify the include paths and files accordingly. I will check the logic of Match-er in the meantime |
16f338b to
ed9d986
Compare
ed9d986 to
b41870a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add regex matching functions similar to Python's
remoduleOverview
This PR adds core regex matching functionality to the NFA matcher, providing a Python
re-like interface for pattern matching operations.Changes
match(const std::string_view &text)MatchResultwith match status, positions, and capture groups.re.match()- only matches at string start.find_all(const std::string_view &text)MatchResultobjects for each match found.re.findall()- scans left to right.escape(const std::string_view &text).,*,+,?,|,(),[],{},^,$,\,-) literal.re.escape()- useful for matching literal strings that may contain regex syntax.Implementation Details
SAVEstates.^,$), character classes, and dot wildcards.match_internal()function supports both anchored and unanchored matching.#14