Don't ask to ask, just ask | |
PerlMonks |
Re: Re: Re: Re: Skipping special tags in regexesby CountZero (Bishop) |
on Dec 05, 2003 at 06:31 UTC ( [id://312446]=note: print w/replies, xml ) | Need Help?? |
That's true, but I was not necessarily thinking of using a hash. An array based datastructure would probably be OK and it has the added benefit of preserving the sequence of the words: this would make it a lot easier to construct the"untagged" sentence for regex-purposes and thereafter, one could split the regexed-sentence on whitespace and compare this list with the array made by splitting the "original" list. All you have to do then is to walk the original list, adding tags to the regexed-list where necessary and skipping the newly inserted words in the regexed-list. You might still have a problem in cases where you introduce duplicate words next to one another. CountZero "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In Section
Seekers of Perl Wisdom
|
|