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

parse hangs on a date-like string with lots of embedded spaces #382

Closed
jonpincus opened this issue Mar 7, 2021 · 2 comments
Closed

parse hangs on a date-like string with lots of embedded spaces #382

jonpincus opened this issue Mar 7, 2021 · 2 comments
Labels

Comments

@jonpincus
Copy link

Trying to parse this string never returns. lt looks like catastrophic backtracking in the regex matching, probably due to all the embedded spaces

const str = 'BGR3                                                                                                                                                                                 186                                                days                                                                                                                                                                                                                                                                                18                                                hours                                                                                                                                                                                                                                                                                37                                                minutes                                                                                                                                                                                                                                                                                01                                                seconds';

chrono.parse(str);
@wanasit
Copy link
Owner

wanasit commented Mar 8, 2021

Hello. Sorry for your bad experience and thanks for reporting this.
Will try to work on it this weekend.

@wanasit
Copy link
Owner

wanasit commented Mar 13, 2021

This is fixed in 98815b5. (2.2.4)

Please note that I fix the problem by limiting the whitespace size.
e.g. Your input won't be extracted as a date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants