fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var isMatch1 = new Regex(@"[^a]*|[^a]*a[^b]*").IsMatch("ab");
  9. Console.WriteLine("[ab] {0}", isMatch1);
  10. var isMatch2 = new Regex(@"[^a]*|[^a]*a[^b]*|[^a]*a[^b]*b[^c]*").IsMatch("abc");
  11. Console.WriteLine("[abc] {0}", isMatch2);
  12. }
  13. }
Success #stdin #stdout 0.11s 29424KB
stdin
Standard input is empty
stdout
[ab] True
[abc] True