Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Regular Expression: DarkMagic.apply('(cm|c.m)')
- -----------------------------------
- FIRST EXAMPLE:
- It will try first pattern on group...
- ( cm | c.m )
- ^^
- abcemtcmncefmf
- ^ => fail 'c'
- abcemtcmncefmf
- ^ => fail 'c'
- abcemtcmncefmf
- ^ => pass 'c' on 'cm'
- abcemtcmncefmf
- ^^ => fail 'm' on 'cm'
- abcemtcmncefmf
- ^ => fail 'c'
- abcemtcmncefmf
- ^ => fail 'c'
- abcemtcmncefmf
- ^ => fail 'c'
- abcemtcmncefmf
- ^ => pass 'c' on 'cm'
- abcemtcmncefmf
- ^^ => pass 'm' on 'cm' => sucess
- -----------------------------------
- SECOND EXAMPLE WITH ANOTHER SUBJECT:
- First will try first pattern on group, it'll fail.
- Then will try the second pattern on group...
- TRYING FIRST GROUP PATTERN
- ( cm | c.m )
- ^^
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => pass 'c' on 'cm'
- abcemtncefmf
- ^^ => fail 'm' on 'cm'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => pass 'c' on 'cm'
- abcemtncefmf
- ^^ => fail 'm' on 'cm'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c' => fail on *first* pattern of group, try next...
- TRYING SECOND GROUP PATTERN
- ( cm | c.m )
- ^^^
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => fail 'c'
- abcemtncefmf
- ^ => pass 'c' on 'c.m'
- abcemtncefmf
- ^^ => pass '.' on 'c.m'
- abcemtncefmf
- ^^^ => pass 'm' on 'c.m' => success on *second* pattern of group
Advertisement
Add Comment
Please, Sign In to add comment