in reply to Dot star okay, or not?
Then you do not need to store the 'middelthing'. This might be quicker, but I don't know this exactly. Anyway it works :)$text=~s/(^\s*|\s*$)//g;
----------------------------------- --the good, the bad and the physi-- -----------------------------------
|
|---|