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

bad escape \s in Drain.py #84

Closed
moesjo opened this issue Aug 12, 2022 · 7 comments
Closed

bad escape \s in Drain.py #84

moesjo opened this issue Aug 12, 2022 · 7 comments

Comments

@moesjo
Copy link

moesjo commented Aug 12, 2022

When running the demo script for drain to following error occures:
re.error: bad escape \s at position 2
Changing line 339 in Drain.py from
template_regex = re.sub(r'\\ +', r'\s+', template_regex)
to
template_regex = re.sub(r'\\ +', r'\\s+', template_regex)
fixed the problem for me.

@moesjo
Copy link
Author

moesjo commented Aug 16, 2022

Already included in several pull requests.

@moesjo moesjo closed this as completed Aug 16, 2022
@shoaib-intro
Copy link

works with drain same issue with spell any idea?

@moesjo
Copy link
Author

moesjo commented Sep 7, 2022

I think for spell it's pretty much the same, there should be a line similar to the one shown above and when you fill in the \ it should work.
Maybe you should also consider using one of the forks of this project, there are some which already include the fixes for these issues (see pull-requests).

@shoaib-intro
Copy link

I think for spell it's pretty much the same, there should be a line similar to the one shown above and when you fill in the \ it should work.
Maybe you should also consider using one of the forks of this project, there are some which already include the fixes for these issues (see pull-requests).

Thanks for reply but I even tried to change drain parameter code with spell does not works....even tried to change concerning line as well....spell keeps working for days but does not bring any output

@moesjo
Copy link
Author

moesjo commented Sep 8, 2022

So i looked it up and from the syntax point of view you only have to change line 312 in Spell.py from

    splitter = re.sub(' +', '\s+', splitters[k])

to

    splitter = re.sub(' +', '\\\s+', splitters[k])

@shoaib-intro
Copy link

So i looked it up and from the syntax point of view you only have to change line 312 in Spell.py from

    splitter = re.sub(' +', '\s+', splitters[k])

to

    splitter = re.sub(' +', '\\\s+', splitters[k])

I have already tried this one, this works but only parameters extraction does not work however it works some other part of dataset but on some dataset having same size does not extract parameters.

@moesjo
Copy link
Author

moesjo commented Sep 8, 2022

Okay, unfortunately I can't help you with this problem but i hope you'll find a fix for that!

xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
* Fix PRs: merge #86, merge #85, merge #83, merge #80, merge #78, merge #65, merge #57, merge #53, merge #52, merge #51, merge #49
* Fix issues: #98, #79, #72, #84, #75, #71, #69, #56, #50, #45, #16, #82
xpai pushed a commit that referenced this issue Sep 5, 2023
xpai pushed a commit that referenced this issue Sep 5, 2023
* Close PRs: close #86, #85, #83, #80, #78, #65, #57, #53, #52, #51, #49
* Fix issues: fix #98, #79, #72, #84, #75, #71, #69, #56, #50, #45, #16, #82
* Release pypi package wheel
xpai pushed a commit that referenced this issue Sep 5, 2023
* Close PRs: close #86, #85, #83, #80, #78, #65, #57, #53, #52, #51, #49
* Fix issues: fix #98, #79, #72, #84, #75, #71, #69, #56, #50, #45, #16, #82
* Release package wheel to pypi
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

2 participants