Manipulating strings with regular expressions

I am struggling with another regex expression. I have:

 test <- "some.a, stuff.b, is.c, here.d, e, f, goaway.g" "some.a, stuff.b, is.c, here.d, e, f, goaway.g" 

I want to:

 gsub("??", "", test) "a, b, c, d, e, f, g" 

I can’t figure out what to put for my template. I tried something like "*\\.?" and it didn’t work. I'm not familiar enough with regex to know what I'm doing.

+4
source share
1 answer

You can try

  [az] + \.

As in, gsub("[az]+\\.", "", test) .

+3
source

Source: https://habr.com/ru/post/1498425/


All Articles