match($0,/Charging, [0-9]+%/){print substr($0,RSTART+10,RLENGTH-11)}
Battery 0: Charging, 18%, 01:37:09 until charged
18
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!