- You can write your own function to do the matching at the SQL level
- Grab all of the keys and process them in PHP. You shouldn’t need regex. Simple string functions should do it.
- Don’t bother processing the results at all and instead just use the
keys you need and ignore the rest– something likeecho $meta['key'];
- Just ask for the particular key you want using
get_post_meta
I doubt that #1 is going to be faster than #2, especially taking into account the built in caching. #3 should perform about as well as #2, given that same built in caching.
I don’t know what isn’t ‘sane’ about those options.