Skip to content

Regexscan fixes #1829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

SolitudePy
Copy link
Contributor

  1. use maxsize argument
  2. switched match to search to search the whole chunk
  3. moved some code from _generator() to run() to reduce overhead

Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, shift the regex compilaytion back into the generator to avoid potential skew. I'm also unkeen on the utf-8/latin1 munging for the sake of it. Otherwise good catch on maxsize not being used


# reapply the regex in order to extract just the match
regex_result = re.match(regex_pattern, result_data)
regex_result = compiled_pattern.search(result_data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The need for this is somewhat annoying, but probably can't be improved at this point without breaking the regexscanner...

@SolitudePy SolitudePy requested a review from ikelos June 11, 2025 16:31
Copy link
Member

@ikelos ikelos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better, thanks. Just a couple more tweaks, nearly there 5:)

@SolitudePy SolitudePy requested a review from ikelos June 12, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants