Unable to figure out the Split File Pattern

I'm not trying to bombard you with my questions, but my new requirement has forced me to post another question.
This is also related to the old question. That solution has a page split based on a pattern. And generating empty headers for the rest of them.

My new attached file is a little different. But i have tried different ways to tweak the given code, but it didn't quite understand the page breaks.

Can someone kindly help again? This time, i will try to get a grasp of how the pattern is identified.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pvsbandiAuthor Commented:
oops..what i meant was
I'm Not trying to bombard you with my questions
This is a different report, so your pattern must change.
(1REPORT ID:\s+?SIDFA2PR(?:\s|\S)*?JURISDICTION (\d{2})(?:\s|\S)*?NUMBER/AMOUNT OF ADJUSTMENTS:\s+?\d{1,}\s+?\d[^ ]* +?\r\n)

Open in new window

And you will need to mock up a new empty report string for your strEmptyText variable, matching an empty version of your new report.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pvsbandiAuthor Commented:

  When i added the pattern to my logic, it is erring out at
et oTS = oFS.opentextfile(cPath & "Report-03.txt", cForReading, False, cTristateFalse)

The error is:
"Compile Error: Constant Expression Required"
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

pvsbandiAuthor Commented:
Mark, it is working! Don't know what went wrong first time, but when i reassigned the path variable as const, it worked out.
Can you please advise how i can get hold of these regular expressions?
That previous article you referred me to, is going over my head.
Let me describe what is happening with this pattern
(1REPORT ID:\s+?SIDFA2PR(?:\s|\S)*?JURISDICTION (\d{2})(?:\s|\S)*?NUMBER/AMOUNT OF ADJUSTMENTS:\s+?\d{1,}\s+?\d[^ ]* +?\r\n)

Open in new window

1. everything that matches the pattern inside parentheses is captured as a group.  There are two capturing groups in this pattern, one for the report page content and one for the jurisdiction number.  Capturing groups are available in the submatches collection.
2. look for "1REPORT ID:\s+?SIDFA2PR"
Note: the \s+? part of the pattern represents one or more space-like characters, which include the space character, tab character, new line character, carriage return character, and page feed character.
3. Ignore anything that comes before "JURISDICTION "
4. capture the two digits
5. Ignore anything that comes before "NUMBER/AMOUNT OF ADJUSTMENTS:"
6. there will be some white space, one or more consecutive digits, more white space, a digit followed by any non-space characters, followed by white space, followed by carriage-return line-feed characters.

(?:\s|\S)*? will match any characters (white space or non-white space) zero or more times.  The question mark at the end says "don't be greedy"
pvsbandiAuthor Commented:
My goodness! It will definitely take a lot of practice and acquaintance to master this.
 Do you have any suggestions to practice these? like, any good book for dummies of sort..
of course, go through Patrick's article first.

http://www.regular-expressions.info/tutorial.html is a good start

I think that Regex Buddy is a very good tool.  They have instructional material on their web site.

YouTube has dozens of regex tutorials

Be aware that not all regex engines support all possible patterns and uses.

I play with my patterns on MyRegexTester.com
pvsbandiAuthor Commented:
Thanks a bunch, Mark!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.