qinwf / re2r

RE2 Regular Expression in R.
https://qinwenfeng.com/re2r_doc
Other
98 stars 15 forks source link

Handle NA_STRING #8

Open qinwf opened 8 years ago

gagolews commented 8 years ago

The desired strategy is to "return NA if the corresponding input is missing".

Btw, will the functions be vectorized with respect to both the "haystack" and the "needle" (e.g., n strings, 1 regex; 1 string, n regexes etc.?)

qinwf commented 8 years ago

Yes. Return the same result as stringi and stringr would be easier for users to learn and use. These two packages provide user-friendly APIs.

I think I can learn from stringi package stri__recycling_rule function.

gagolews commented 8 years ago

sure, give it a try;

BTW, this is not an exported function but in some of the cases you may call stringi functions from C code directly, take a look at https://github.com/gagolews/ExampleRcppStringi

tdhock commented 8 years ago

about vectorizing "1 string, n regexes" -- what is the use case? I only use the other "n strings, 1 regex" version

tdhock commented 8 years ago

btw for the n string, n regexes case there is https://github.com/tdhock/revector