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

Stuck on /^^ #866

Closed
sublee opened this issue Aug 29, 2018 · 2 comments
Closed

Stuck on /^^ #866

sublee opened this issue Aug 29, 2018 · 2 comments

Comments

@sublee
Copy link

sublee commented Aug 29, 2018

^^ is a weird regexp. When I grep it with the /^^ command, tig got stuck.

These regexps make tig get stuck:

  • ^^
  • $$
  • (a|a?)+
  • (a?|a+)*
@cascassette
Copy link

Is that because those are illegal or stupid expressions? Can't have $$ nor ^^, third and fourth are both equal to a*.

@sublee
Copy link
Author

sublee commented Aug 29, 2018

Yes, they are stupid or malicious but not illegal.

^^ means that a literal ^ at the head in BRE (only the first ^ is treated as a metacharacter), or just any heads in ERE and/or PCRE (same with single ^). (a|a?)+ is a malicious expression obviously. It is usually used for ReDoS attacks. It can be optimized as a* as you mentioned. But it is also not an illegal regexp.

grep doesn't get stuck with those regexps.

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