I am trying to match all the possiblities using regular expressions. When I try them individually, it works fine. But, when I try to test it for the String test, it fails. I am not sure why this happens. Can anyone please help ? Here is the code ...
[ December 17, 2004: Message edited by: seema prakash ]
I copied a neat trick from Martin Fowler's FitNesse Wiki ... sorry I can't point right to the doc to explain it.
I put a collection of Command objects into the expression array. Each object has a "public static final String pattern" and a "public void execute(fragment)" that knows what to do with that kind of fragment.
Lemme know if that helps!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I am very thankful to both Thomas and Stan for the suggestions. Let me explain what I am trying to achieve. I have a word document. I convert this into a text file. I store the contents of the text file in a string. I need to identify the subheadings such as SUMMARY in case this is a resume which has SUMMARY as one of the subheadings. Once 2 consecutive sections are identified, I will be able to process the contents in between these sections. To do that I create a regular expression such that I can identify a section. But, the regular expression to identify the SUMMARY section does not seem to work. I am not sure if the regular expression is right. Is this the right way I am approaching?
Here is the sample code ...
keep an eye out for scorpions and black widows. But the tiny ads are safe.
Free, earth friendly heat - from the CodeRanch trailboss