Recently here an R question was answered by mrdwab that used a regex that was pretty cool (LINK). I liked the response but can't generalize it because I don't understand what's happening (I fooled with the different numeric values being supplied but that didn't really yield anything useful). Could someone break the regex down piece by piece and explain what's happening?
x <- c("WorkerId", "pio_1_1", "pio_1_2", "pio_1_3", "pio_1_4", "pio_2_1",
"pio_2_2", "pio_2_3", "pio_2_4")
gsub("([a-z])_([0-9])_([0-9])", "\\1_\\3\\.\\2", x) #Explain me please
Thank you in advance.