Skip to content

Instantly share code, notes, and snippets.

@yoonsy
Created April 12, 2013 08:35
Show Gist options
  • Save yoonsy/5370517 to your computer and use it in GitHub Desktop.
Save yoonsy/5370517 to your computer and use it in GitHub Desktop.
JS 특정 패턴과 일치하는 문자열 뽑아내기
"hello _there_".replace(/_(.*?)_/, function(a, b){
return '<div>' + b + '</div>';
})
"hello _there_".replace(/_(.*?)_/, "<div>$1</div>")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment