[Vala] vala regex question.



// hello.cs
using System;
using System.Text.RegularExpressions;

class HelloWorld {
  public static void Main() {
      System.IO.StreamReader sr = new
System.IO.StreamReader(@"/opt/the-board/share/vala-0.12/vapi/cairo.vapi");
      string gscode = sr.ReadToEnd();
      sr.Close();
      Console.WriteLine(gscode);

      Regex r = new Regex(@"\{.*?\}", RegexOptions.Singleline);
      System.Text.RegularExpressions.MatchCollection mc = r.Matches(gscode);

      foreach (System.Text.RegularExpressions.Match m in mc)
      {
          Console.WriteLine(m.Value);
      }
  }
}

I think that python's dir method is usable. so

$vapidir "cairo-1.0/Matrix" => show matrix detail : pick up from
dictionary {..., "Matrix": matrix_struct_difinition, ... }

maybe usable too...but I don't know vala's multi-line regex matching.
Above code is csharp case. Is enable that vala's case?

Thanks in advance for any help.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]