Skip to content

Instantly share code, notes, and snippets.

Created August 19, 2014 16:52
Show Gist options
  • Save anonymous/6a6e5e96fba4f2579316 to your computer and use it in GitHub Desktop.
Save anonymous/6a6e5e96fba4f2579316 to your computer and use it in GitHub Desktop.
RE_REDMINE_LINKS = %r{([\s\(,\-\[\>]|^)(!)?(([a-z0-9\-_]+):)?(attachment|document|version|forum|news|message|project|commit|source|export)?(((#)|((([a-z0-9\-_]+)\|)?(r)))((\d+)((#note)?-(\d+))?)|(:)([^"\s<>][^\s<>]*?|"[^"]+?"))(?=(?=[[:punct:]][^A-Za-z0-9_/])|,|\s|\]|<|$)}
def redmine_links_match(text)
@redmine_links_match ||= {}
@redmine_links_match[text] ||= RE_REDMINE_LINKS.match(text)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment