tags:

views:

41

answers:

1

i am parsing binary file. File size can be large. i want to search a some pattern in that file. the string is

anynumber 0 obj<< any
alpha,symbol,digit...anything
>>endobj

Bold text indicates compulsory string. So, My QUESTION is - should i do it by regular expression or search it by coding. After that i want to store it in a dictionary. If regular expression then what it be?? what is the fastest way?? I am new to C# and using VS-2005.

A: 
\d+0 obj\<\<.*\>\>endobj

\d    - decimal digit
+     - 1 or more
\<    - < should be treated as a literal
.     - any character
*     - 0 or more
>    - > should be treated as a literal

Jay Bazuzi
Royson
yes, a '.' matches any character.
Jay Bazuzi
Not any character. A period does not match a new line character by default.
Mark Byers