Created
April 12, 2013 08:35
-
-
Save yoonsy/5370517 to your computer and use it in GitHub Desktop.
JS 특정 패턴과 일치하는 문자열 뽑아내기
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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