Strange, I didn’t even understand that partial coincidence is a thing.
Instead of directly indexing in the dataframe, you can try to determine the records that exactly match the name rowname and build the indexing vector from the result, for example:
> ix <- 'a' == row.names(df)
> df[ix,]
<0 rows> (or 0-length row.names)
( ):
> df['a' == row.names(df),]
, , :
> library(data.table)
> dt <- data.table(df)
> dt[,ix := vec]
> setkey(dt, ix)
> dt['a']
a b ix
1: NA NA a
> dt['a11']
a b ix
1: 0 1 a11