JaimePolop / RExpository

MIT License
71 stars 8 forks source link

Remove unnecessary groups #3

Closed Langlais115 closed 1 year ago

Langlais115 commented 1 year ago

I arrive on this repo from: https://github.com/makikvues/PEASS-ng/blob/master/build_lists/download_regexes.py

Whereas the PEASS-ng only uses pattern matching.

So, if you ONLY use pattern matching, this commit will reduce Memory, CPU usage, and time it takes to press these regex.

But, if your project use pattern matching AND pattern groups, please DO NOT merge this.

Langlais115 commented 1 year ago

Hummm, this is strange. All regex test are failing. But my regex are correct.

Ex: https://regex101.com/r/rlrPoK/1

Failure (md5): Regex '(?:^|[^a-zA-Z0-9])[a-fA-F0-9]{32}(?:[^a-zA-Z0-9]|$)' did not match the example '129aF9e0aFD4537EF7cBEfdD48Bd2E5B'

JaimePolop commented 1 year ago

Hummm, this is strange. All regex test are failing. But my regex are correct. https://regex101.com/r/rlrPoK/1

Failure (md5): Regex '(?:^|[^a-zA-Z0-9])[a-fA-F0-9]{32}(?:[^a-zA-Z0-9]|$)' did not match the example '129aF9e0aFD4537EF7cBEfdD48Bd2E5B'

Yes, I think there is something wrong but not with the regex, it's probably the bash script. I will check it and merge everything ASAP. Thanks for contributing :D !!

carlospolop commented 1 year ago

Hi @Langlais115,

We needed to remove the "?:" syntax from regexes because it's not supported by grep -E. It is supported by grep -P but some OS like macOS or openBSD doesn't support this option in grep. As this point linpeas is the main program using these regexes and this would break linpeas in those OSs we cannot merge this commit. An option would be to create alternatives inside the yaml, but this would make it more complex to maintain.

Langlais115 commented 1 year ago

Ok, thank you for your feedback. I'm closing this pull request.