Guest User

Untitled

a guest
Jan 29th, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. Regular Expression: DarkMagic.apply('(cm|c.m)')
  2.  
  3. -----------------------------------
  4.  
  5. FIRST EXAMPLE:
  6. It will try first pattern on group...
  7.  
  8. ( cm | c.m )
  9. ^^
  10.  
  11. abcemtcmncefmf
  12. ^ => fail 'c'
  13. abcemtcmncefmf
  14. ^ => fail 'c'
  15. abcemtcmncefmf
  16. ^ => pass 'c' on 'cm'
  17. abcemtcmncefmf
  18. ^^ => fail 'm' on 'cm'
  19. abcemtcmncefmf
  20. ^ => fail 'c'
  21. abcemtcmncefmf
  22. ^ => fail 'c'
  23. abcemtcmncefmf
  24. ^ => fail 'c'
  25. abcemtcmncefmf
  26. ^ => pass 'c' on 'cm'
  27. abcemtcmncefmf
  28. ^^ => pass 'm' on 'cm' => sucess
  29.  
  30. -----------------------------------
  31.  
  32. SECOND EXAMPLE WITH ANOTHER SUBJECT:
  33.  
  34. First will try first pattern on group, it'll fail.
  35. Then will try the second pattern on group...
  36.  
  37. TRYING FIRST GROUP PATTERN
  38.  
  39. ( cm | c.m )
  40. ^^
  41.  
  42. abcemtncefmf
  43. ^ => fail 'c'
  44. abcemtncefmf
  45. ^ => fail 'c'
  46. abcemtncefmf
  47. ^ => pass 'c' on 'cm'
  48. abcemtncefmf
  49. ^^ => fail 'm' on 'cm'
  50. abcemtncefmf
  51. ^ => fail 'c'
  52. abcemtncefmf
  53. ^ => fail 'c'
  54. abcemtncefmf
  55. ^ => fail 'c'
  56. abcemtncefmf
  57. ^ => fail 'c'
  58. abcemtncefmf
  59. ^ => pass 'c' on 'cm'
  60. abcemtncefmf
  61. ^^ => fail 'm' on 'cm'
  62. abcemtncefmf
  63. ^ => fail 'c'
  64. abcemtncefmf
  65. ^ => fail 'c'
  66. abcemtncefmf
  67. ^ => fail 'c'
  68. abcemtncefmf
  69. ^ => fail 'c' => fail on *first* pattern of group, try next...
  70.  
  71. TRYING SECOND GROUP PATTERN
  72.  
  73. ( cm | c.m )
  74. ^^^
  75.  
  76. abcemtncefmf
  77. ^ => fail 'c'
  78. abcemtncefmf
  79. ^ => fail 'c'
  80. abcemtncefmf
  81. ^ => pass 'c' on 'c.m'
  82. abcemtncefmf
  83. ^^ => pass '.' on 'c.m'
  84. abcemtncefmf
  85. ^^^ => pass 'm' on 'c.m' => success on *second* pattern of group
Advertisement
Add Comment
Please, Sign In to add comment