- or download this
$text =~ /\b(\d+)/
- or download this
if ($text =~ /\b(\d+)\b/) {
print("Matched $1\n");
}
- or download this
# The first standalone number.
$text =~ /\b(\d+)\b/
- or download this
# By context.
$text =~ /(\d+) months? old/
- or download this
# The last number.
$text =~ /^.*\b(\d+)/