D
David Elliott
I am having a problem with a specific scenario with regular expressions. I am doing
some document processing and am looking for date formats within a document.
When I try to access the a property such as Count, after using Regex.Matches(),
the application hangs for several minutes, at which time it picks up and continues.
This is unfortunately causing severe performance issues for the rest of the server.
I have included a working console application which is included below. The byte
array is the data that I was given to be processed. If you look at it, once it is a string,
you will see that it is actually copyright, trademarks, etc. As the data comes to me
via automation, I can not validate it before hand.
As I stated before, I am looking for dates. Given the input data, I would expect to
see NO results. At worst, an exception thrown, but NOT hanging the system.
Any help is appreciated.
If you have any questions, please feel free to contact me for more information.
Cheers,
Dave
===========================
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.Text.RegularExpressions;
namespace regex
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Regex rx;
MatchCollection mc;
string inText;
string exPattern;
int count;
byte[] data =
{
0xff,0xfe,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x0d,0x00,
0x0a,0x00,0x20,0x00,0x0d,0x00,0x0a,0x00,0x0d,0x00,0x0a,0x00
};
inText = Encoding.Unicode.GetString(data);
count = 0;
exPattern = @"(\D+[\.]* +\D* *\d+ *,0x *\d+)";
Console.Out.WriteLine("Starting...");
try
{
// Create Regular Expression
rx = new Regex(exPattern);
// Perform the Regex Match
mc = null;
mc = rx.Matches(inText);
if (mc != null)
{
count += mc.Count;
Console.Out.WriteLine("Number of matches found: " + count.ToString());
}
Console.Out.WriteLine("Regular Expressions are done");
}
catch (Exception ex)
{
string s = ex.Message;
s = null;
}
System.Console.Out.WriteLine("Matches: " + count.ToString());
}
}
}
some document processing and am looking for date formats within a document.
When I try to access the a property such as Count, after using Regex.Matches(),
the application hangs for several minutes, at which time it picks up and continues.
This is unfortunately causing severe performance issues for the rest of the server.
I have included a working console application which is included below. The byte
array is the data that I was given to be processed. If you look at it, once it is a string,
you will see that it is actually copyright, trademarks, etc. As the data comes to me
via automation, I can not validate it before hand.
As I stated before, I am looking for dates. Given the input data, I would expect to
see NO results. At worst, an exception thrown, but NOT hanging the system.
Any help is appreciated.
If you have any questions, please feel free to contact me for more information.
Cheers,
Dave
===========================
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.Text.RegularExpressions;
namespace regex
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Regex rx;
MatchCollection mc;
string inText;
string exPattern;
int count;
byte[] data =
{
0xff,0xfe,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xa9,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,
0x20,0x00,0xa9,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0xa9,0x00,0x20,0x00,0xae,0x00,0x20,0x00,0xae,0x00,
0x20,0x00,0xae,0x00,0x20,0x00,0x22,0x21,0x20,0x00,0xae,0x00,0x20,0x00,0x0d,0x00,
0x0a,0x00,0x20,0x00,0x0d,0x00,0x0a,0x00,0x0d,0x00,0x0a,0x00
};
inText = Encoding.Unicode.GetString(data);
count = 0;
exPattern = @"(\D+[\.]* +\D* *\d+ *,0x *\d+)";
Console.Out.WriteLine("Starting...");
try
{
// Create Regular Expression
rx = new Regex(exPattern);
// Perform the Regex Match
mc = null;
mc = rx.Matches(inText);
if (mc != null)
{
count += mc.Count;
Console.Out.WriteLine("Number of matches found: " + count.ToString());
}
Console.Out.WriteLine("Regular Expressions are done");
}
catch (Exception ex)
{
string s = ex.Message;
s = null;
}
System.Console.Out.WriteLine("Matches: " + count.ToString());
}
}
}