Advertisement
Guest User

Regexdemo

a guest
Jul 24th, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.45 KB | None | 0 0
  1. Demo
  2.  
  3. /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
  4.  
  5.  
  6. Options: case insensitive; ^ and $ match at line breaks
  7.  
  8. Match the character “/” literally «/»
  9. Match the regular expression below and capture its match into backreference number 1 «((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])»
  10. Match either the regular expression below (attempting the next alternative only if this one fails) «(?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+»
  11. Match the regular expression below «(?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+»
  12. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  13. Match either the regular expression below (attempting the next alternative only if this one fails) «\((?:\([^()]+\)|[^()]+)+\)»
  14. Match the character “(” literally «\(»
  15. Match the regular expression below «(?:\([^()]+\)|[^()]+)+»
  16. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  17. Match either the regular expression below (attempting the next alternative only if this one fails) «\([^()]+\)»
  18. Match the character “(” literally «\(»
  19. Match a single character NOT present in the list “()” «[^()]+»
  20. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  21. Match the character “)” literally «\)»
  22. Or match regular expression number 2 below (the entire group fails if this one fails to match) «[^()]+»
  23. Match a single character NOT present in the list “()” «[^()]+»
  24. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  25. Match the character “)” literally «\)»
  26. Or match regular expression number 2 below (attempting the next alternative only if this one fails) «\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]»
  27. Match the character “[” literally «\[»
  28. Match the regular expression below «(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+»
  29. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  30. Match either the regular expression below (attempting the next alternative only if this one fails) «\[[^\[\]]*\]»
  31. Match the character “[” literally «\[»
  32. Match a single character NOT present in the list below «[^\[\]]*»
  33. Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
  34. A [ character «\[»
  35. A ] character «\]»
  36. Match the character “]” literally «\]»
  37. Or match regular expression number 2 below (attempting the next alternative only if this one fails) «['"][^'"]*['"]»
  38. Match a single character present in the list “'"” «['"]»
  39. Match a single character NOT present in the list “'"” «[^'"]*»
  40. Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
  41. Match a single character present in the list “'"” «['"]»
  42. Or match regular expression number 3 below (the entire group fails if this one fails to match) «[^\[\]'"]+»
  43. Match a single character NOT present in the list below «[^\[\]'"]+»
  44. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  45. A [ character «\[»
  46. A ] character «\]»
  47. One of the characters “'"” «'"»
  48. Match the character “]” literally «\]»
  49. Or match regular expression number 3 below (attempting the next alternative only if this one fails) «\\.»
  50. Match the character “\” literally «\\»
  51. Match any single character that is not a line break character «.»
  52. Or match regular expression number 4 below (the entire group fails if this one fails to match) «[^ >+~,(\[\\]+»
  53. Match a single character NOT present in the list below «[^ >+~,(\[\\]+»
  54. Between one and unlimited times, as many times as possible, giving back as needed (greedy) «+»
  55. One of the characters “ >+~,(” « >+~,(»
  56. A [ character «\[»
  57. A \ character «\\»
  58. Or match regular expression number 2 below (the entire group fails if this one fails to match) «[>+~]»
  59. Match a single character present in the list “>+~” «[>+~]»
  60. Match the regular expression below and capture its match into backreference number 2 «(\s*,\s*)?»
  61. Between zero and one times, as many times as possible, giving back as needed (greedy) «?»
  62. Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s*»
  63. Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
  64. Match the character “,” literally «,»
  65. Match a single character that is a “whitespace character” (spaces, tabs, and line breaks) «\s*»
  66. Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
  67. Match the regular expression below and capture its match into backreference number 3 «((?:.|\r|\n)*)»
  68. Match the regular expression below «(?:.|\r|\n)*»
  69. Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»
  70. Match either the regular expression below (attempting the next alternative only if this one fails) «.»
  71. Match any single character that is not a line break character «.»
  72. Or match regular expression number 2 below (attempting the next alternative only if this one fails) «\r»
  73. Match a carriage return character «\r»
  74. Or match regular expression number 3 below (the entire group fails if this one fails to match) «\n»
  75. Match a line feed character «\n»
  76. Match the characters “/g,” literally «/g,»
  77. Match a line break
  78.  
  79.  
  80. Created with RegexBuddy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement