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

Add tests to ensure portability of regex syntax #138

Open
gschneider-r7 opened this issue Jun 15, 2017 · 0 comments
Open

Add tests to ensure portability of regex syntax #138

gschneider-r7 opened this issue Jun 15, 2017 · 0 comments

Comments

@gschneider-r7
Copy link
Contributor

There are some regexes using Ruby's \h syntax for hexadecimal values, but in other runtimes \h means horizontal whitespace. These regexes will not match correctly outside of Ruby. Instead we should be using [a-f\d] (unless someone has a better idea).

There should be test coverage to ensure that the regexes are not relying on special Ruby-only features so we can avoid any issues with this in the future.

Examples:
https://github.com/rapid7/recog/blob/master/xml/ftp_banners.xml#L219
https://github.com/rapid7/recog/blob/master/xml/ftp_banners.xml#L1126
https://github.com/rapid7/recog/blob/master/xml/ftp_banners.xml#L1136
https://github.com/rapid7/recog/blob/master/xml/ftp_banners.xml#L1194

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

No branches or pull requests

1 participant