Constant

BlueCloth::LinkRegex

Link defs are in the form: ^[id]: url "optional title"

%r{
      ^[ ]*\[(.+)\]:                # id = $1
        [ ]*
        \n?                         # maybe *one* newline
        [ ]*
      <?(\S+?)>?                            # url = $2
        [ ]*
        \n?                         # maybe one newline
        [ ]*
      (?:
              # Titles are delimited by "quotes" or (parens).
              ["(]
              (.+?)                        # title = $3
              [")]                 # Matching ) or "
              [ ]*
      )?    # title is optional
      (?:\n+|\Z)
}x
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.