Advertisement
CristianCantoro

wikilink_regex

Mar 11th, 2016
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. r'''\[\[                    # Match two opening brackets
  2.    (?P<link>               # <link>:
  3.        [^\|]{0,256}?       # Text inside link group
  4.                            # everything not a pipe, non-greedy
  5.                            # up to 256 characters
  6.    )
  7.    \|?                     # Match an optional pipe
  8.    (?P<anchor>             # <anchor>:
  9.        [^\|]{0,4096}?      # Text inside anchor group
  10.                            # everything not a pipe, non-greedy
  11.                            # up to 4096 characters
  12.    )
  13.    \]\]                    # Match two closing brackets
  14. '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement