示例#1
0
    public void TestRender()
    {
        var regex = new RegexAnalyze("aa1222", @"\d");

        regex.Match();
        var content = regex.Compiler("{for} {" +
                                     "   '{}'," +
                                     "} {end}");

        Assert.IsTrue(content.IndexOf("1") > 0);
    }
示例#2
0
 private void StartMatch()
 {
     if (string.IsNullOrWhiteSpace(RegexTb.Text) || string.IsNullOrWhiteSpace(ContentTb.Text))
     {
         return;
     }
     ViewModel.AddHistory(RegexTb.Text);
     ViewModel.MatchItems.Clear();
     _regex = new RegexAnalyze(ContentTb.Text, RegexTb.Text);
     _regex.Match();
     foreach (Match item in _regex.Matches)
     {
         ViewModel.MatchItems.Add(new MatchItem(item));
     }
 }
示例#3
0
 private void _startMatch()
 {
     RegexTb.Items.Add(RegexTb.Text);
     _lists.Clear();
     if (string.IsNullOrWhiteSpace(MatchTb.Text))
     {
         return;
     }
     _regex = new RegexAnalyze(MatchTb.Text, RegexTb.Text);
     _regex.Match();
     foreach (Match item in _regex.Matches)
     {
         _lists.Add(new MatchItem(item));
     }
     Listbox.ItemsSource = _lists;
     CountLb.Text        = "添加了 " + _lists.Count.ToString(CultureInfo.InvariantCulture) + " 条数据";
 }