Scripting >> Perl >> how to extract a specific substring from a bigger string

Example 1. To extract the size in bytes part of the following string $string = "Document 1342, Microsoft Word - application form-CUHK.doc owned by CLGSONG was printed on cclcgo4 via port 155.69.50.247:RAW. Size in bytes: 531829; pages printed: 0" $bytes = $string; $bytes =~ s/.*Size.in.bytes[:].(.*)[;].*//; print $bytes;