If I understand your question correctly:
$string=~s/(pattern1).*(pattern2)/$1$2/s; [download]
In reply to Re: need a regex by jethro in thread need a regex by Anonymous Monk