Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. string expression = "q(\d*)(M)?(T(?!H))?(W)?(TH)?(F)?(S(?!U))?(SU)?";
  2.  
  3. q(\d*)(?=(?:M|T(?!H)|W|TH|F|S(?!U)|SU))(M)?(T(?!H))?(W)?(TH)?(F)?(S(?!U))?(SU)?
  4.  
  5. q(\d*)(?=(?:M|TH?|W|TH|F|SU?))(M)?(T(?!H))?(W)?(TH)?(F)?(S(?!U))?(SU)?
  6.  
  7. var rx = new Regex(@"q(d*)(?=(?:M|TH?|W|TH|F|SU?))(M)?(T(?!H))?(W)?(TH)?(F)?(S(?!U))?(SU)?");
  8. var result = rx.Match("q10MSUT").Value;
  9.  
  10. q(?<number>d+)((?<monday>(?<!MD*)M)|(?<tuesday>(?<!T(?!H)D*)T(?!H))|(?<wednesday>(?<!WD*)W)|(?<thursday>(?<!THD*)TH)|(?<friday>(?<!FD*)F)|(?<saturday>(?<!S(?!U)D*)S(?!U))|(?<sunday>(?<!SUD*)SU))+
  11.  
  12. q(d*)(M|TH?|W|F|SU?)+
  13.  
  14. q(d*)(TH|SU|[MTWFS])+(?<=qd*M?T?W?(?:TH)?F?S?(?:SU)?)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement