GithubHelp home page GithubHelp logo

qinwf / re2r Goto Github PK

View Code? Open in Web Editor NEW
98.0 11.0 15.0 1.08 MB

RE2 Regular Expression in R.

Home Page: https://qinwenfeng.com/re2r_doc

License: Other

R 15.06% C++ 84.19% C 0.10% JavaScript 0.41% HTML 0.17% Rebol 0.07%
regular-expression re2 r

re2r's Introduction

re2r

Build Status Build status CRAN_Status_Badge codecov

RE2 is a primarily DFA based regexp engine from Google that is very fast at matching large amounts of text.

Installation

From CRAN:

install.packages("re2r")

From GitHub:

library(devtools)
install_github("qinwf/re2r", build_vignettes = T)

To learn how to use, you can check out the vignettes.

Related Work

Google Summer of Code - re2 regular expressions.

Brief Intro

1. Search a string for a pattern

re2_detect(string, pattern) searches the string expression for a pattern and returns boolean result.

test_string = "this is just one test";
re2_detect(test_string, "(o.e)")
## [1] TRUE

Here is an example of email pattern.

show_regex("\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}\\b", width = 670, height = 280)

email pattern

re2_detect("[email protected]", "\\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}\\b")
## [1] TRUE

re2_match(string, pattern) will return the capture groups in ().

(res = re2_match(test_string, "(o.e)"))
##      .match .1   
## [1,] "one"  "one"

The return result is a character matrix. .1 is the first capture group and it is unnamed group.

Create named capture group with (?P<name>pattern) syntax.

(res = re2_match(test_string, "(?P<testname>this)( is)"))
##      .match    testname .2   
## [1,] "this is" "this"   " is"
is.matrix(res)
## [1] TRUE
is.character(res)
## [1] TRUE
res$testname
## testname 
##   "this"

If there is no capture group, the matched origin strings will be returned.

test_string = c("this is just one test", "the second test");
(res = re2_match(test_string, "is"))
##      .match
## [1,] "is"  
## [2,] NA

re2_match_all() will return the all of patterns in a string instead of just the first one.

res = re2_match_all(c("this is test", 
            "this is test, and this is not test", 
            "they are tests"), 
          pattern = "(?P<testname>this)( is)")
print(res)
## [[1]]
##      .match    testname .2   
## [1,] "this is" "this"   " is"
## 
## [[2]]
##      .match    testname .2   
## [1,] "this is" "this"   " is"
## [2,] "this is" "this"   " is"
## 
## [[3]]
##      .match testname .2
is.list(res)
## [1] TRUE

match all numbers

texts = c("pi is 3.14529..",
          "-15.34 °F",
          "128 days",
          "1.9e10",
          "123,340.00$",
          "only texts")
(number_pattern = re2(".*?(?P<number>-?\\d+(,\\d+)*(\\.\\d+(e\\d+)?)?).*?"))
## re2 pre-compiled regular expression
## 
## pattern: .*?(?P<number>-?\d+(,\d+)*(\.\d+(e\d+)?)?).*?
## number of capturing subpatterns: 4
## capturing names with indices: 
## .match number .2 .3 .4
## expression size: 56
(res = re2_match(texts, number_pattern))
##      .match          number       .2     .3       .4   
## [1,] "pi is 3.14529" "3.14529"    NA     ".14529" NA   
## [2,] "-15.34"        "-15.34"     NA     ".34"    NA   
## [3,] "128"           "128"        NA     NA       NA   
## [4,] "1.9e10"        "1.9e10"     NA     ".9e10"  "e10"
## [5,] "123,340.00"    "123,340.00" ",340" ".00"    NA   
## [6,] NA              NA           NA     NA       NA
res$number
## [1] "3.14529"    "-15.34"     "128"        "1.9e10"     "123,340.00"
## [6] NA
show_regex(number_pattern)

number pattern

2. Replace a substring

re2_replace(string, pattern, rewrite)

Searches the string "input string" for the occurence(s) of a substring that matches 'pattern' and replaces the found substrings with "rewrite text".

input_string = "this is just one test";
new_string = "my"
re2_replace(new_string, "(o.e)", input_string)
## [1] "my"

mask the middle three digits of a US phone number

texts = c("415-555-1234",
          "650-555-2345",
          "(416)555-3456",
          "202 555 4567",
          "4035555678",
          "1 416 555 9292")

us_phone_pattern = re2("(1?[\\s-]?\\(?\\d{3}\\)?[\\s-]?)(\\d{3})([\\s-]?\\d{4})")

re2_replace(texts, us_phone_pattern, "\\1***\\3")
## [1] "415-***-1234"   "650-***-2345"   "(416)***-3456"  "202 *** 4567"  
## [5] "403***5678"     "1 416 *** 9292"

3. Extract a substring

re2_extract(string, pattern, replacement)

Extract matching patterns from a string.

re2_extract("yabba dabba doo", "(.)")
## [1] "y"
re2_extract("[email protected]", "(.*)@([^.]*)")
## [1] "test@me"

4. Regular Expression Object for better performance

We can create a regular expression object (RE2 object) from a string. It will reduce the time to parse the syntax of the same pattern.

And this will also give us more option for the pattern. run help(re2) to get more detials.

regexp = re2("test",case_sensitive = FALSE)
print(regexp)
## re2 pre-compiled regular expression
## 
## pattern: test
## number of capturing subpatterns: 0
## capturing names with indices: 
## .match
## expression size: 10
regexp = re2("test",case_sensitive = FALSE)
re2_match("TEST", regexp)
##      .match
## [1,] "TEST"
re2_replace("TEST", regexp, "ops")
## [1] "ops"

5. Multithread

Use parallel option to enable multithread feature. It will improve performance for large inputs with a multi core CPU.

re2_match(string, pattern, parallel = T)

re2r's People

Contributors

4562448 avatar qinwf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

re2r's Issues

Rcpp exception with UTF-8 strings on Windows

This Rcpp issue will affect the error message for regular expression.

re2("this (is 测试")
#> Error: missing closing ): this (is 娴嬭瘯 

Here is an issue about related to this before.

[Rcpp-devel] Unicode on windows 1

[Rcpp-devel] Unicode on windows 2

The solution in the above mailing list posts can not solve the exception handling string problem.

I send an email to the Rcpp mailing list about this issue, and here is links to the discussion:

[Rcpp-devel] Rcpp exception with UTF-8 strings on Windows 1

[Rcpp-devel] Rcpp exception with UTF-8 strings on Windows 2

It seems that Rcpp will not fix this very soon. So I suggest to use the origin R-C API to rewrite existing codes.

cran submission?

Hey @qinwf I would like to teach a class about regular expressions in R, and it would be great if you could put re2r on CRAN, so that windows/mac users without compilers could download the binary package. Do you think you have time to do a CRAN submission some time in the next few weeks?

Issue while installing devtools::install_github("r-lib/rlang")

Hi all,

I'm having trouble installing rland on windows 10. I am using R studio Version 1.1.442 – © 2009-2018 RStudio, Inc.

ERROR:

devtools::install_github("r-lib/rlang")
Downloading GitHub repo r-lib/rlang@master
from URL https://api.github.com/repos/r-lib/rlang/zipball/master
Installing rlang
"C:/PROGRA1/R/R-341.4/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL
"C:/Users/jaisri.s/AppData/Local/Temp/RtmpS6AzWp/devtools2a3861af857/r-lib-rlang-1da4a6a"
--library="C:/Users/jaisri.s/Documents/R/win-library/3.4" --install-tests

  • installing source package 'rlang' ...
    ** libs
    c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA1/R/R-341.4/include" -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c capture.c -o capture.o
    c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA1/R/R-341.4/include" -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c export.c -o export.o
    In file included from export.c:1:0:
    export/exported.c: In function 'rlang_cnd_type':
    export/exported.c:28:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
    c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA1/R/R-341.4/include" -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c internal.c -o internal.o
    c:/Rtools/mingw_64/bin/gcc -I"C:/PROGRA1/R/R-341.4/include" -DNDEBUG -I./lib/ -O2 -Wall -std=gnu99 -mtune=generic -c lib.c -o lib.o
    In file included from lib.c:8:0:
    lib/cnd.c:142:24: fatal error: Rinterface.h: No such file or directory
    #include <Rinterface.h>
    ^
    compilation terminated.
    make: *** [lib.o] Error 1
    Warning: running command 'make -f "Makevars" -f "C:/PROGRA1/R/R-341.4/etc/x64/Makeconf" -f "C:/PROGRA1/R/R-341.4/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="rlang.dll" WIN=64 TCLBIN=64 OBJECTS="capture.o export.o internal.o lib.o"' had status 2
    ERROR: compilation failed for package 'rlang'
  • removing 'C:/Users/jaisri.s/Documents/R/win-library/3.4/rlang'
  • restoring previous 'C:/Users/jaisri.s/Documents/R/win-library/3.4/rlang'
    In R CMD INSTALL
    Installation failed: Command failed (1)

tbb errors on windows

When installing and compiling on windows I got

C:/rtools40/mingw64/bin/g++ -shared -s -static-libgcc -o re2r.dll tmp.def RcppExports.o bitstate.o compile.o dfa.o logging.o mimics_pcre.o nfa.o onepass.o parse.o perl_groups.o prog.o re2.o re2r_attr.o re2r_compile.o re2r_count.o re2r_extract.o re2r_locate.o re2r_match.o re2r_replace.o re2r_simplify.o re2r_split.o re2r_subset.o re2r_util.o regexp.o rune.o simplify.o stringpiece.o strutil.o tostring.o unicode_casefold.o unicode_groups.o -LC:PROGRA~1RR-devellibraryRCPPPA~1libx64 -ltbb -ltbbmalloc -Lc:/PROGRA~1/R/R-devel/bin/x64 -lR
c:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ltbb
c:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ltbbmalloc
collect2.exe: error: ld returned 1 exit status
no DLL was created
ERROR: compilation failed for package 're2r'

can not install the package on centos

g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I../inst/include -DNDEBUG -DNO_RE2_THREADS -I/usr/local/include -I"/usr/lib64/R/library/Rcpp/include" -I"/usr/lib64/R/library/RcppParallel/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppExports.cpp -o RcppExports.o
In file included from ../inst/include/re2r.h:43,
from RcppExports.cpp:4:
../inst/include/optional.hpp:115: 错误:expected unqualified-id before ‘using’
../inst/include/optional.hpp:134: 错误:ISO C++ 不允许声明无类型的‘constexpr’
../inst/include/optional.hpp:134: 错误:expected ‘;’ before ‘static’
../inst/include/optional.hpp:142: 错误:expected constructor, destructor, or type conversion before ‘static’
../inst/include/optional.hpp:144: 错误:‘declval’不是‘std’的成员
../inst/include/optional.hpp:144: 错误:expected primary-expression before ‘>’ token
../inst/include/optional.hpp:144: 错误:expected primary-expression before ‘)’ token
../inst/include/optional.hpp:144: 错误:‘declval’不是‘std’的成员
../inst/include/optional.hpp:144: 错误:expected primary-expression before ‘>’ token
../inst/include/optional.hpp:144: 错误:expected primary-expression before ‘)’ token
../inst/include/optional.hpp:146: 错误:expected constructor, destructor, or type conversion before ‘static’
../inst/include/optional.hpp:148: 错误:ISO C++ 不允许声明无类型的‘constexpr’
../inst/include/optional.hpp:148: 错误:expected ‘;’ before ‘static’
../inst/include/optional.hpp:157: 错误:ISO C++ 不允许声明无类型的‘constexpr’

benchmark web page crashes my computer

@qinwf The docs you have written are really great, but I would recommend using PNG instead of plotly for the benchmark plots. On my computer with only 2GB of memory the system crashes. On another computer with 12GB it loads after a delay, and makes the memory usage of firefox increase by about 2GB. I think this can be fixed by rendering the plots as static PNG which are less memory intensive than plotly which uses javascript and SVG.

make: *** [dfa.o] Error 1

Hi all,

I'm having trouble installing re2r on Ubuntu 16.10 (Yakkety Yak). The error is below and appears to be related to a gcc problem (google/re2#102)
I've been unable to resolve it by updating to the latest gcc (version 6.2.0 20161018 (Ubuntu 6.2.0-7ubuntu11) or including flags in the src/Makevars to try to force it to use clang instead (always defaults to g++)
"CC = clang
CXX = clang++"

Error below:

g++ -I/usr/share/R/include -DNDEBUG -I../inst/include -DNDEBUG -I"/home/skynet2/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/home/skynet2/R/x86_64-pc-linux-gnu-library/3.3/RcppParallel/include" -fpic -g -O2 -fdebug-prefix-map=/build/r-base-qk3a9o/r-base-3.3.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c dfa.cc -o dfa.o
dfa.cc: In constructor ‘re2::DFA::State::State()’:
dfa.cc:95:10: error: unknown array size in delete
struct State {
^~~~~
dfa.cc: In member function ‘re2::DFA::State* re2::DFA::CachedState(int*, int, re2::uint)’:
dfa.cc:703:9: note: synthesized method ‘re2::DFA::State::State()’ first required here
State state;
^~~~~
/usr/lib/R/etc/Makeconf:139: recipe for target 'dfa.o' failed
make: *** [dfa.o] Error 1
ERROR: compilation failed for package ‘re2r’

  • removing ‘/home/skynet2/R/x86_64-pc-linux-gnu-library/3.3/re2r’
    Error: Command failed (1)

re2r being removed from CRAN

I have received a mail from the CRAN maintainers because I have a CRAN package that imports re2r:

re2r will unfortunately now be removed/archived by the CRAN maintainers due to CRAN check problems (see below) (some of which seem to be addressed by @Pilipino in #21).

re2r works in many cases much faster than the other available regex implementations in R, so this is very regrettable indeed. I do not myself have the necessary C/C++ etc. competency to fix the issues.

Copied from https://cran.r-project.org/web/checks/check_results_re2r.html on 4 March 2020:

Check Details
Version: 0.2.0
Check: for GNU extensions in Makefiles
Result: NOTE
GNU make is a SystemRequirements.
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-patched-solaris-x86, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 0.2.0
Check: pragmas in C/C++ headers and code
Result: NOTE
Files which contain pragma(s) suppressing diagnostics:
'inst/include/re2/prog.h' 'inst/include/re2/re2.h'
'inst/include/re2/regexp.h' 'src/dfa.cc' 'src/onepass.cc'
Flavors: r-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-release-linux-x86_64, r-release-windows-ix86+x86_64, r-oldrel-windows-ix86+x86_64

Version: 0.2.0
Check: whether package can be installed
Result: WARN
Found the following significant warnings:
compile.cc:292:69: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class re2::Prog::Inst’; use assignment or value-initialization instead [-Wclass-memaccess]
regexp.cc:343:33: warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class re2::Regexp’ with no trivial copy-assignment [-Wclass-memaccess]
regexp.cc:344:32: warning: ‘void* memmove(void*, const void*, size_t)’ writing to an object of type ‘class re2::Regexp’ with no trivial copy-assignment [-Wclass-memaccess]
Flavors: r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-ix86+x86_64-gcc8, r-patched-linux-x86_64, r-release-linux-x86_64

Version: 0.2.0
Check: installed package size
Result: NOTE
installed size is 11.7Mb
sub-directories of 1Mb or more:
doc 1.5Mb
libs 9.0Mb
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-windows-ix86+x86_64, r-devel-windows-ix86+x86_64-gcc8, r-release-windows-ix86+x86_64, r-release-osx-x86_64, r-oldrel-windows-ix86+x86_64, r-oldrel-osx-x86_64

Version: 0.2.0
Check: for unstated dependencies in ‘tests’
Result: WARN
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Warning in deparse(e[[2L]]) :
it is not known that wchar_t is Unicode on this platform
Flavor: r-patched-solaris-x86

TO DO: test with long vectors

Since R 3.0, vectors can be of size > 2^31-1 (sole character strings are restricted to 2^31 - 1 bytes)

e.g., R_xlen_t n = xlength(x).

compilation warnings

Hi, I installed the package and got some compilation warnings:

dfa.cc:72:19: warning: unused variable 'ExtraDebug' [-Wunused-const-variable]
static const bool ExtraDebug = false;
                  ^
1 warning generated.
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c mimics_pcre.cc -o mimics_pcre.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c nfa.cc -o nfa.o
nfa.cc:44:19: warning: unused variable 'ExtraDebug' [-Wunused-const-variable]
static const bool ExtraDebug = false;
                  ^
1 warning generated.
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c onepass.cc -o onepass.o
onepass.cc:76:19: warning: unused variable 'ExtraDebug' [-Wunused-const-variable]
static const bool ExtraDebug = false;
                  ^
1 warning generated.
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c parse.cc -o parse.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c perl_groups.cc -o perl_groups.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c prog.cc -o prog.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c re2.cc -o re2.o
clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include' -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -Wall -g -O2  -c re2r_attr.cpp -o re2r_attr.o
re2r_attr.cpp:178:10: warning: lambda capture 'this' is not used [-Wunused-lambda-capture]
        [this, &tt](tr2::optional<string> &x) -> tr2::optional<string> {
         ^~~~~
1 warning generated.

Move htmlwidgets to suggests

I suggest move the htmlwidgets package to Suggests to reduce dependencies. It's not affect the core functionality.
htmlwidgets recursively depends on digest, htmltools, jsonlite, yaml.

pattern too large (compile failed)

re2_match_all(text,pattern_name,parallel = T)
pattern_name is name of length 60000,via"|"paste. such as:嘉兴市鑫港房地产|某某某|你开呀
i want to find if the "text" contain of the name, and which the name the "text" contain,
thks

error:
Error in cpp_re2_compile(stri_enc_toutf8(pattern), log_errors_value = log_error, :
pattern too large (compile failed):

Question: argument order

For example: re2_match(pattern, string)

for some the reverse arg order is more natural (string, pattern) (see e.g., stringr functions)

(string, pattern) works better with magrittr's pipe operator to

string %>% re2_match(pattern)

what do you think?

Solaris build

I'll help you with a Solaris build. I have access to a SPARC-based machine which has a similar configuration as the CRAN one.

Once you're ready, msg me.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.