Skip to content

Instantly share code, notes, and snippets.

View SergeyMirvoda's full-sized avatar

Sergey Mirvoda SergeyMirvoda

  • Octonica, UrFU
  • Yekaterinburg
View GitHub Profile
@SergeyMirvoda
SergeyMirvoda / R_named_group_capture
Last active November 12, 2016 11:48
Примеры вывода групп из регулрного выражения. В т.ч. именованных
library(stringr)
strings <- "xy1234wz98xy567"
phone <- "(?<name>\\d+)"
str_extract(strings, phone)
str_match(strings, phone)
str_match_all(strings, phone)
str_match_all_perl <- function(string,pattern){
parsed <- gregexpr(pattern,string,perl=TRUE)
lapply(seq_along(parsed),function(i){

Keybase proof

I hereby claim:

  • I am sergeymirvoda on github.
  • I am mirvoda (https://keybase.io/mirvoda) on keybase.
  • I have a public key whose fingerprint is 1589 296D 119B 81E8 BC0C E767 9967 C4AE 5589 E756

To claim this, I am signing this object: