If I have these strings:
mystrings <- c(\"X2/D2/F4\", \"X10/D9/F4\", \"X3/D22/F4\", \"X9/D22/F9\")
as.numeric(gsub("^.*D([0-9]+).*$", "\\1", mystrings))