What the manual page says is that you define the regular expression in a Regular Expression asset, then call the preg_match keyword with the asset ID of that Regular Expression asset.
So instead of:
%asset_metadata_height^preg_match:/^\d+$/%
you would create a Regular Expression asset, set the asset’s regular expression to be /^\d+$/ and then call the keyword like this:
%asset_metadata_height^preg_match:<assetid>%
replacing <assetid> with the actual asset ID of your Regular Expression asset. Does that make more sense?