Created
December 16, 2013 20:43
-
-
Save ericdke/7994050 to your computer and use it in GitHub Desktop.
Get Markdown text from Markdown link
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
def getMarkdownText(str) | |
str.gsub %r{ | |
\[ # Literal opening bracket | |
( # Capture what we find in here | |
[^\]]+ # One or more characters other than close bracket | |
) # Stop capturing | |
\] # Literal closing bracket | |
\( # Literal opening parenthesis | |
( # Capture what we find in here | |
[^)]+ # One or more characters other than close parenthesis | |
) # Stop capturing | |
\) # Literal closing parenthesis | |
}x, '\1' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment