is there/will there be perl support in stringr?

Hi all,

First off, not 100% sure the type of question I'm asking is on-topic for this forum, so I can close if necessary.

I was attempting to use str_replace replace a lower case letter with an upper case one. In sub, I would use:

> sub("(Hi)", "\\U\\1",  "Hi, how's it going?", perl = T)
[1] "HI, how's it going?"

since the \U is perl-style regex.

This, of course, fails in stingr:

> str_replace("Hi, how's it going?", "(Hi)", "\\U\\1")
[1] "1, how's it going?"

I'm not looking for a solution, I have one.

I was just curiuous to know if perl regex is supported in stringr, if not, are there plans to, and if not, why?

Your question is definitely on-topic, but very likely you would get more attention from the stringr maintainers if you file an issue on the github repo.

1 Like

hi Yes, I considered filing an issue but since I wasn’t if perl was supported, I thought I’d ask here first. Thanks!

I don't think so, since stringr is based on stringi and it uses the ICU library as regex engine.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.