Skip to content
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

Convert hex regex patterns to be language-agnostic and fix bad Windows OS catch-all regex #143

Merged
merged 2 commits into from
Jun 19, 2017

Conversation

gschneider-r7
Copy link
Contributor

@gschneider-r7 gschneider-r7 commented Jun 16, 2017

As indicated in #138 the use of \h is a special feature of Ruby's regex engine. For other languages and runtimes it causes the matches to fail since it has a different meaning. I replaced all occurrences that I could find.

Additionally I fixed the Windows OS catch-all regex which had really bad backtracking performance, especially in Java where it would take 20-30 seconds to match (or not match) for a single string. Since it is super generic anyway I got rid of the attempt at capturing a version for it as well.

This regex was really bad and took 20-30 seconds to match in java. After
this change it comes down to milliseconds.
@vmacdougal-r7 vmacdougal-r7 merged commit bed241f into rapid7:master Jun 19, 2017
@gschneider-r7 gschneider-r7 deleted the compat_fix branch June 19, 2017 15:26
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.

3 participants