>>>>> "JE" == Jon Ericson <> writes:
JE> Uri Guttman <> writes:
>>
>> home_run: /\bH\b/ | /\bHR\b/
>>
>> also i was under the impression that basic P:RD will split input on
>> white space so the home_run production should only match H when the
>> token is H.
JE> Right. The problem is this data is *not* split into tokens by white
JE> space. For instance `H8' is the code for an inside the park home run
JE> fielded by the center fielder. Sorry I didn't make that clear.
well, i can't help much with poor specs!
JE> Someone wrote an email with the suggestion:
JE> home_run: /H(?![A-Z])/ | 'HR'
JE> That does the trick, I think.
looks ok. if you gave a complete spec then we could help more.
JE> I'm not sure Parse::RecDescent is the right tool for the job, but it
JE> sure is fun to play around with.
sounds like overkill for this. is it all just one line? P:RD is meant
for real grammars and such and what you have seems like a simple string
with some tricky parsing. a decent set of regexes could do that but a
proper and full spec is needed.
uri
--
Uri Guttman ------
--------
http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ----------------------------
http://jobs.perl.org