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

Unexpected error with parse_date_time() #1143

Open
ramiromagno opened this issue Oct 15, 2023 · 0 comments
Open

Unexpected error with parse_date_time() #1143

ramiromagno opened this issue Oct 15, 2023 · 0 comments

Comments

@ramiromagno
Copy link

ramiromagno commented Oct 15, 2023

I guess the error below should have been a warning, like the one indicated earlier.

library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#> 
#>     date, intersect, setdiff, union
parse_date_time("2020-11-12", orders = "md")
#> Warning: All formats failed to parse. No formats found.
#> [1] NA
parse_date_time("2020-11-12", orders = "yymd")
#> Warning in regexpr(reg, x, ignore.case = TRUE, perl = TRUE): PCRE pattern compilation error
#>  'two named subpatterns have the same name (PCRE2_DUPNAMES not set)'
#>  at '\d{4})|(?<y>\d{2}))(?!\d)\D*?((?<Om>1[0-2]|0?[1-9](?!\d))|(((?<Om_b>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?<Om_B>January|February|March|April|May|June|July|August|September|October|November|December))(?![[:alpha:]])))\D*?(?<d>[012]?[1-9]|3[01]|[12]0)(?!\d))|(((?<Y_y_e>\d{4})|(?<y_e>\d{2}))\D*?((?<Y_y_e>\d{4})|(?<y_e>\d{2}))\D*?((?<Om_e>1[0-2]|0[1-9])|(((?<Om_b_e>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?<Om_B_e>January|February|March|April|May|June|July|August|September|October|November|December))(?![[:alpha:]])))\D*?(?<d_e>[012][1-9]|3[01]|[12]0)))\D*$'
#> Error in regexpr(reg, x, ignore.case = TRUE, perl = TRUE): invalid regular expression '^\D*?\b((((?<Y_y>\d{4})|(?<y>\d{2}))(?!\d)\D*?((?<Y_y>\d{4})|(?<y>\d{2}))(?!\d)\D*?((?<Om>1[0-2]|0?[1-9](?!\d))|(((?<Om_b>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?<Om_B>January|February|March|April|May|June|July|August|September|October|November|December))(?![[:alpha:]])))\D*?(?<d>[012]?[1-9]|3[01]|[12]0)(?!\d))|(((?<Y_y_e>\d{4})|(?<y_e>\d{2}))\D*?((?<Y_y_e>\d{4})|(?<y_e>\d{2}))\D*?((?<Om_e>1[0-2]|0[1-9])|(((?<Om_b_e>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?<Om_B_e>January|February|March|April|May|June|July|August|September|October|November|December))(?![[:alpha:]])))\D*?(?<d_e>[012][1-9]|3[01]|[12]0)))\D*$'

Created on 2023-10-15 with reprex v2.0.2

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

1 participant