title: How to extract a substring of certain length after matching pattern in R?
body: <p>I have a list of string: <code>string = c("PT11201320360429", "POSTEST1120122380820", "POST_TEST1120122380820")</code>. I need to get a vector of string that contains only the FOUR numbers after PT11, POSTEST11, or POST_TEST11 (i.e.2013, 2012, or 2012). How can I do this in R? Thanks!</p>