improved the regex for better code snippet extraction. fixed #3