#!/usr/bin/perl -w use strict; my $a = "OpenGL vendor string: NVIDIA Corporation"; if ($a =~ m/OpenGL vendor string:(.*?)$/) { print "$1"; }