fork(3) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace RegExApplication
  5. {
  6. public class Program
  7. {
  8. public static void Main(string[] args)
  9. {
  10. string input = "(( { dbo.Document.MimeType_ID in (select ID from MimeType where Name ='PDF')} Or { dbo.WorkflowItem.CurrentStateName not like 'On_Hold%'} ) And ( { dbo.DocumentMetaData.Field_ID=74 And dbo.DocumentMetaData.FieldValue Not like '%test%'} And { dbo.Document.FileName='karan'} ))";
  11. string pattern = "\\{\\s*([^}]+)\\s*\\}";
  12. Regex rgx = new Regex(pattern);
  13.  
  14. Match match = rgx.Match(input);
  15.  
  16. while (match.Success)
  17. {
  18. Console.WriteLine(match.Groups[1].Value);
  19. match = match.NextMatch();
  20. }
  21. }
  22. }
  23. }
Success #stdin #stdout 0.11s 24672KB
stdin
Standard input is empty
stdout
dbo.Document.MimeType_ID in (select ID from MimeType where Name ='PDF')
dbo.WorkflowItem.CurrentStateName not like 'On_Hold%'
dbo.DocumentMetaData.Field_ID=74 And  dbo.DocumentMetaData.FieldValue Not like '%test%'
dbo.Document.FileName='karan'