http://www.perlmonks.org?node_id=988423


in reply to Regex match last

Try this. It uses @ as alternate regex-character (instead of /) and captures any (single) tag within a line.
#!/usr/bin/perl use strict; use warnings; my $data = '<c:t="AD2343"/><c:p>65677676</c:p>'; if ($data =~ m@.*(<c:[^>]*/>).*@) { print("Match: [$1]\n"); }