Advertisement
jargon

Broken "URL" BBCode (PCRE)

Mar 28th, 2017
3,145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PCRE 0.41 KB | None | 0 0
  1. pattern:
  2. /(?P<bbcode_open>\[)(?P<tag>(?P<tag_arg>url)((="(?P<tag_attr>[^"]*)"){0,1}))(?P<par>(( (?<par_arg>[a-z]+)="(?P<par_attr>[^"])")*){0,1})(?P<bbcode_close>\])(?P<body>((?:(?!(?P=bbcode_open)(?P=tag_arg)(=| |\])).)+?){0,1})(?P=bbcode_open)(?P<bbcode_slash>\/)(?P=tag_arg)(?P=bbcode_close)/
  3.  
  4. replace:
  5. <a href="$6"$7>$13</a>
  6.  
  7. subject:
  8. [url="hi.jpg" class="menu" style="font-face: monospace;"]hi (jpeg)[/url]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement