#!/usr/bin/env perl use strict; use warnings; my $text = <<'EOD'; Service Location: 1234 n street ave, Some City, ST, 99999, US EOD $text =~ /Service Location:\s+(.*\S)\s*$/m; print "$1\n";