r-lib / rex

Friendly regular expressions for R.
https://rex.r-lib.org
Other
334 stars 27 forks source link

starts_with() and n_times() interactions #7

Closed jimhester closed 10 years ago

jimhester commented 10 years ago
starts_with('x') %>% n_times(3) # (?:^x){3}

This will basically never match anything, because it is has to match the beginning of the line followed by a x three times. This combination needs to return ^(?:x){3}. You can get the correct thing with start, 'x' %>% n_times(3), but best way to achieve this with start_this()