ACF – Eliminate unnecessary data and print

You have to use a regex, in this case, to extract the needed value from a string:

$string = 'Energizer AA Rechargeable Batteries 2300 mAh NiMH';

preg_match('/([0-9]+\s*mah)/i', $string, $capacity );
    
if ( isset( $capacity[0] ) ) {
    printf('Battery: %s', $capacity[0] );
}

This regex /([0-9]+\s*mah)/i will look for any numbers followed by case insensitive mah combination.

You can test this regex online here https://regex101.com/r/KDdHbp/1/

Also, here is documentation on preg_match https://www.php.net/manual/en/function.preg-match.php