diff --git a/R/guess.r b/R/guess.r index 1a0fc41f..6d2420fa 100644 --- a/R/guess.r +++ b/R/guess.r @@ -338,7 +338,7 @@ guess_formats <- function(x, orders, locale = Sys.getlocale("LC_TIME"), p <- p[nzchar(p)] alpha["p"] <- if ( length(p) == 0L ) "" - else sprintf("(?
%s)(?![[:alpha:]])", paste(p, collapse = "|")) + else sprintf("(?
%s)(?![[:alpha:]])", paste(p, collapse = "|"))
alpha <- unlist(alpha)
@@ -405,10 +405,10 @@ guess_formats <- function(x, orders, locale = Sys.getlocale("LC_TIME"),
num_exact <- num_flex <- num
num_flex[] <- sprintf("%s(?!\\d)", num)
-
- num_exact[] <- gsub("(?", "_e>", num))) # append _e to avoid duplicates
+ ## it is crittcal tu use fixed = TRUE because of the multibyte bug #181
+ num_exact[] <- gsub("(?", "_e>", num, fixed = TRUE))) # append _e to avoid duplicates
num_flex["m"] <- sprintf("((?