Advertisement
jargon

bbcode, pattern/replace

Dec 20th, 2016
3,280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PCRE 1.08 KB | None | 0 0
  1. /\[color\=\"([A-Za-z]+)\"]([^[]+?[^]])\[\/color\]/
  2. /\[color\=\"(\#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f])\"]([^[]+?[^]])\[\/color\]/
  3. /\[color\=\"(\#[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f])\"]([^[]+?[^]])\[\/color\]/
  4. \[(sub)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  5. \[(sup)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  6. \[(b)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  7. \[(i)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  8. \[(u)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  9. \[(s)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  10. \[(tt)\](.{0,2}|[^\[][^\1][^\]]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  11. \[(url)\=\"([^\"])\"\](.{0,2}|[^\[][^\1][^\=]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  12. \[(u)\=\"([^\"])\"\](.{0,2}|[^\[][^\1][^\=]*|[^\[][^\/][^/1][^\]]*)\[\/\1\]
  13.  
  14. ===
  15.  
  16. <font color="$1">$2</font>
  17. <font color="$1">$2</font>
  18. <font color="$1">$2</font>
  19. <$1>$2</$1>
  20. <$1>$2</$1>
  21. <$1>$2</$1>
  22. <$1>$2</$1>
  23. <$1>$2</$1>
  24. <$1>$2</$1>
  25. <$1>$2</$1>
  26. <a href="$2" target="_blank">$3</a>
  27. <a href="$2" target="_blank">$3</a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement