Skip to content

Instantly share code, notes, and snippets.

@tzafrir
Created May 11, 2012 01:41
Show Gist options
  • Save tzafrir/2656974 to your computer and use it in GitHub Desktop.
Save tzafrir/2656974 to your computer and use it in GitHub Desktop.
.replace(/(([\s()\.,!?]|^)((<[^>]*>)|[-_])*)\*([^\n]*?[^\s])\*(((<[^>]*>)|[-_])*([()\.,!?]|$|\s))/g, '$1<b>$5</b>$6')
.replace(/(([\s()\.,!?]|^)((<[^>]*>)|[-\*])*)_([^\n]*?[^\s])_(((<[^>]*>)|[-\*])*([()\.,!?]|$|\s))/g, '$1<i>$5</i>$6')
.replace(/(([\s()\.,!?]|^)((<[^>]*>)|[\*_])*)-([^\n]*?[^\s])-(((<[^>]*>)|[\*_])*([()\.,!?]|$|\s))/g, '$1<s>$5</s>$6')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment