You could use sub
here for a base R option:
input = "Table 1.1. Patient Completion Summary"
table_name <- sub("^.*\b(Table \d+(?:\.\d+)*).*$", "\1", input)
table_name
[1] "Table 1.1"
This answer is flexible and makes no assumptions about the table name, other than it be some number, followed by optional dot separator and digit, zero or more times over.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…