소스 검색

Fix checking for unicode chars that need escaped

tags/v0.2.0
Garrick Aden-Buie 8 년 전
부모
커밋
4a60607136
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      R/regex_gadget.R

+ 1
- 1
R/regex_gadget.R 파일 보기

@@ -320,7 +320,7 @@ regex_gadget <- function(text = NULL,

sanitize_text_input <- function(x) {
if (is.null(x) || !nchar(x)) return(x)
if (grepl("\\u|\\x|\\N|\\a|\\o", x)) {
if (grepl("\\u[0-9a-f]{4,8}|\\x[0-9a-f]{2}|\\x\\{[0-9a-f]{1,6}\\}|\\N|\\0[0-8]{1,3}", x)) {
try({
y <- stringi::stri_unescape_unicode(x)
}, silent = TRUE)

Loading…
취소
저장