Fix regex mistake, added some details in comments