Re: [Rd] FR: valid_regex() to test string validity as a regular expression

2023-10-09 Thread Tomas Kalibera
On 10/10/23 01:57, Michael Chirico via R-devel wrote: > It will be useful to package authors trying to validate input which is > supposed to be a valid regular expression. > > As near as I can tell, the only way we can do so now is to run any > regex function and check for the warning and/or cond

Re: [Rd] FR: valid_regex() to test string validity as a regular expression

2023-10-09 Thread Duncan Murdoch
On 09/10/2023 7:57 p.m., Michael Chirico via R-devel wrote: It will be useful to package authors trying to validate input which is supposed to be a valid regular expression. As near as I can tell, the only way we can do so now is to run any regex function and check for the warning and/or conditi

[Rd] FR: valid_regex() to test string validity as a regular expression

2023-10-09 Thread Michael Chirico via R-devel
It will be useful to package authors trying to validate input which is supposed to be a valid regular expression. As near as I can tell, the only way we can do so now is to run any regex function and check for the warning and/or condition to bubble up: valid_regex <- function(str) { stopifnot(i