my $pattern1 = qr/(word)-(spacing):\s*[\d]+px/; # word spacing regexp my $pattern2 = qr/(letter)-(spacing):\s*[\d]+px/; # letter spacing regexp