question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error parsing Regex strings in newest v1.2.6

See original GitHub issue

Up 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:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
rshippcommented, Oct 15, 2018

Pushed to PyPI as v1.2.7.

@Neo23x0 can you confirm this and #24 are fixed with v1.2.7?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found