oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
623 stars 64 forks source link

Processing of Perl-compatible regexps for gsub() differs from the GNU R #15

Closed SwapnilGaikwad closed 6 years ago

SwapnilGaikwad commented 6 years ago

For the gsub() function, processing of Perl-compatible regexps differs from the GNU R.

FastR ( commit acc680f)

> str <- "R> Line 1\n Line 2\n"
> gsub(">.*\n|\n", "", str, perl=TRUE)
[1] "R"
> gsub(">.*\n|\n", "", str, perl=FALSE)
[1] "R"

GNU R ( version 3.2.3 )

> str <- "R> Line 1\n Line 2\n"
> gsub(">.*\n|\n", "", str, perl=TRUE)
[1] "R Line 2"
> gsub(">.*\n|\n", "", str, perl=FALSE)
[1] "R"
> gsub(">.*\n|\n", "", str)
[1] "R"
steve-s commented 6 years ago

Thank you for reporting this issue, it should be now fixed in commit 2aa4c56b5eb, which should be mirrored to GitHub soon.