Error parsing Regex strings in newest v1.2.6
See original GitHub issueUp to now I was working with version 1.2.5, which worked fine. The newest master produces errors with many of my regex YARA strings.
Traceback (most recent call last):
File "mjolnir.py", line 166, in readFiles
rulesList = p.parse_string(fileData)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/plyara-1.2.6-py3.6.egg/plyara.py", line 210, in parse_string
yacc.parse(input_string)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ply-3.11-py3.6.egg/ply/yacc.py", line 333, in parse
return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ply-3.11-py3.6.egg/ply/yacc.py", line 1201, in parseopt_notrack
tok = call_errorfunc(self.errorfunc, errtoken, self)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/ply-3.11-py3.6.egg/ply/yacc.py", line 192, in call_errorfunc
r = errorfunc(token)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/plyara-1.2.6-py3.6.egg/plyara.py", line 1087, in p_error
raise TypeError(u'Unknown text {} for token of type {} on line {}'.format(p.value, p.type, p.lineno))
TypeError: Unknown text [ for token of type LBRACK on line 78
The parser fails on regular expression strings like this
$d = /\x00https?:\/\/[^\x00]{4,500}\x00\x00\x00/
I guess that this commit introduced the errors: https://github.com/plyara/plyara/commit/0c4e814e139cac27c9cf0f7945b534c99c960c47
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Error parsing Regex Expression [closed] - Stack Overflow
The error that is thrown when using a regular string literal is error CS1009: Unrecognized escape sequence \*' , etc. – Wiktor Stribiżew....
Read more >UTS #18: Unicode Regular Expressions
Note: The Unicode Standard is constantly evolving: new characters will be ... Constraint: parse error if in range with 1st literal > 2nd ......
Read more >Regex — Elixir v1.12.3 - HexDocs
Compiles the regular expression and raises Regex.CompileError in case of errors. escape(string). Escapes a string to be literally matched in a regex.
Read more >rust-lang/regex - GitHub
regex. A Rust library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a few ......
Read more >regex() - Humio Documentation
This function both works as a filter and can extract new fields using a regular expression. The regular expression can contain one or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in https://github.com/plyara/plyara/commit/0e1847dafee6a6108711e93e9e15ffec48c3eedb
Pushed to PyPI as v1.2.7.
@Neo23x0 can you confirm this and #24 are fixed with v1.2.7?