In Ruby it is dead simple:
str[/\[(.*)\]/,1].hex # "=> 37" , or .to_i(16)and dead unreadablePharo way is both dead simple and dead readablestr:= ' �� �� �� Temperature 0 �� �� �� �� �� 37C (98F) [0x25] (TMPIN0)'.('16r',(text copyWithRegex: '(.*\[0x)|(\].*)' ��matchesReplacedWith: '')) asNumber .��