use the classes in System.Text.RegularExpressions, for exampleusing System;
using System.Text.RegularExpressions; string s = @"<input type=text  id=acb>
<input type=""file"" onpropertychange=xxx value=yyy>
<TEXTAREA>[...]
abc</TEXTAREA>
";
Regex re = new Regex(@"<input(?<input1>[^>]+)>\s*<input type=""file""(?<input2>[^>]+)>\s*<TEXTAREA[^>]*>(?<textarea>.*?)</TEXTAREA>",RegexOptions.IgnoreCase | RegexOptions.Singleline);
Match m = re.Match(s);
if (m.Success)
{
Console.WriteLine("input:{0}\ninput2:{1}\ntextarea:{2}",
m.Groups["input1"].Value,
m.Groups["input2"].Value,
m.Groups["textarea"].Value);
}

解决方案 »

  1.   

    saucer(思归) ( ) 信誉:326 哇!!!我是来看五星上将的。
      

  2.   

    copy the following into a file, say, TestReg.cs:using System;
    using System.Text.RegularExpressions;class TestReg
    {  static void Main()
      {
    string s = @"<input type=text  id=acb>
    <input type=""file"" onpropertychange=xxx value=yyy>
    <TEXTAREA>[...]
    abc</TEXTAREA>
    ";
    Regex re = new Regex(@"<input(?<input1>[^>]+)>\s*<input type=""file""(?<input2>[^>]+)>\s*<TEXTAREA[^>]*>(?<textarea>.*?)</TEXTAREA>",RegexOptions.IgnoreCase | RegexOptions.Singleline);
    Match m = re.Match(s);
    if (m.Success)
    {
    Console.WriteLine("input:{0}\ninput2:{1}\ntextarea:{2}",
    m.Groups["input1"].Value,
    m.Groups["input2"].Value,
    m.Groups["textarea"].Value);
    }
      }
    }
    then compile itcsc TestReg.cs
      

  3.   

    一群马屁精,saucer(思归) ( ) 信誉:326  的确没有出来任何东西
      

  4.   

    you compiled it and ran it? I tested on windows 2003 with .net 1.1, here is output:
    F:\csharp>notepad TestReg.csF:\csharp>csc TestReg.cs
    Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
    for Microsoft (R) .NET Framework version 1.1.4322
    Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.
    F:\csharp>TestReg
    input: type=text  id=acb
    input2: onpropertychange=xxx value=yyy
    textarea:[...]
    abcF:\csharp>