in reply to Regexp: How to match in middle but not the ends?

TIMTOWDI, and assuming, your string need not be checked against containing only legal characters:
my $string = '---LL--C----LCSH-------CSHL-------LCSLH-------LCCHLSHCL- +---'; foreach (split /L*-+L*/, $string) { print $_,"\n" if length($_)>2; }
Update: I just noticed: This will fail if the string starts or ends with "L" and not with "-" or anything else. So making the $string in the split a "-$string-" is one workaround.

s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e