digs = "filepath/23-00.xlsx"sub("^\\D+(\\d+).*", "\\1", digs)
Standard input is empty
[1] "23"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!