use strict; use warnings; use utf8; use feature qw( unicode_strings ); binmode STDOUT, ':utf8'; my $string = 'XYZ • Qno-483, sec-9a,ABS • P:(110) 53345345345 • F: (210) 123231231'; printf "Code point for '•': %X\n", ord('•'); if ( $string =~ m/ ^ ( [^\N{U+2022}]+ ) \s\N{U+2022} # Matches XYZ. \s ( [^\N{U+2022}]+ ) \s\N{U+2022} # Matches Qno-483, sec-9a,ABS \sP:\s* ( [^\N{U+2022}]+ ) \s\N{U+2022} # Matches P:(110) 53345345345 \sF:\s* ( [^\N{U+2022}]+ ) \s*$ # Matches F: (210) 123231231 /x ) { print "Match:\n\$1: [$1]\n\$2: [$2]\n\$3: [$3]\n\$4: [$4]\n"; } else { print "Your input string doesn't resemble the one posted to PerlMonks.\n"; } #### Code point for '•': 2022 Match: $1: [XYZ] $2: [Qno-483, sec-9a,ABS] $3: [(110) 53345345345] $4: [(210) 123231231]