I need help deciphering Regex
(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1
This came from showdown.js
(\*\*|__)          match ** or __
(?=\S)             -> look ahead for *one* non-space character? what for? 
([^\r]*?\S[*_]*)   -> zero or more non-carriage-returns, why newlines \n allowed?, one non-space, zero or more * or _ characters
\1                 ends with 1st capture: ** or __
I mainly don't get the 2nd & 3rd lines
 
     
    