Graphene is an attractive material for flexible electronics and biosensors, yet its zero bandgap nature has limited the on/off ratio of field-effect transistors (FETs) and the sensitivity of biosensors based on graphene. Graphene nanomesh (GNM), a continuous 2D graphene nanostructure with a high density of holes punched in the basal plane, has been created to introduce lateral confinement and enable improved on/off ratio. However, the GNMs produced to date typically have a relatively large dimension (constriction neck width >5 nm) and low on/off ratio (≈100) limited by the resolution of the lithography process used. Here, the exploration of a directly grown mesoporous silica template is reported for the preparation of ultrafine GNMs with considerably narrower neck width (<3 nm) and strong quantum confinement to enable flexible FETs with greatly improved on/off ratio (up to 1000). With excellent electronic properties and high surface area for the functionalization of specific receptors, it is further shown that the GNM FETs can be readily used to construct highly sensitive biosensors for selective detection of human epidermal growth factor receptor 2, which is further demonstrated for real-time detection of breast cancer cells overexpressed with receptor 2 down to single-cell level. The studies provide a simple and scalable method to GNMs with potential applications for flexible nanoelectronics and biosensors.