"be consistent" | |
PerlMonks |
Re: How do I extract a text between some delimitersby jkahn (Friar) |
on Sep 13, 2002 at 18:23 UTC ( [id://197686]=note: print w/replies, xml ) | Need Help?? |
I'm sure there's a CPAN module that does generic tag extraction, but it might not conform to the form you're using here (I assume you're testing/building a part-of-speech tagger).
Barring a CPAN module (untested code follows, please tell me if this doesn't work -- it may be missing some whitespace in the substitution, for example):
Let's break that out:
Hope that helps, -- jkahn Update (ca. 9p GMT-8): I've just realized that this code won't work if there are nested tags, e.g.:
Anonymous Monk, does this happen in your input data? I will look at this and see if I can come up with a good answer if it does, or if I feel like it.....
In Section
Seekers of Perl Wisdom
|
|