try the following short program. it find any char & or % or |
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
string myString = "1&2|3%4&5|6%";
Match m = Regex.Match(myString,@"[&\|%]");
int matchCount = 0;
while (m.Success)
{
Console.WriteLine("Match"+ (++matchCount) + "\t\t" + m.Value);
m = m.NextMatch();
}
Console.ReadLine();
}
}
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Juan" <ju*****************@ANTISPAMhotmail.com> wrote in message
news:OU*************@tk2msftngp13.phx.gbl...
Hi, I´m using System.Text.RegularExpressions, I want to find any acurrence
of the char & or % or |
Ehat is the correct sintax for the Match method? This is what I´m usinf
but is not working:
Match myMatch = Regex.Match(myString,"^[&|%]*$");
Thanks,
Juan.