#!/usr/bin/perl use strict; use warnings; my $string = '\P{\H1.4x;Proximitar-Objekt, type Ni 22U-Q40-AP6X2-H1141, Example, see \fTimes New Roman|b0|i0|c0|p18;\C170;((B2 3503_0 Sh.14))}'; my ($text) = $string =~ m~ \\P\{ (.*) \} ~x; $text =~ s!\\[A-Za-z].*?;!!g; print $text;