Re: using split on input strings over 256 chars
"Daniel F. Savarese" <[email protected]>
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
In message <[email protected]>, Scott Tester w rites: >I've noticed that when the input string going into >split is larger then 256, split ignores the first 256 >chars and only processes the last part. > >I couldn't find any info on the list archives about >this. Is there a workaround for this? Before you assume what you're experiencing is a bug, please follow the guidelines at: http://jakarta.apache.org/oro/bugs.html If you really can't figure out what's going on, post code that isolates and reproduces the problem so that list members can make an attempt at diagnosing the problem. In any case, many thanks for mailing the list before submitting a Bugzilla report! However, I can say with a high level of certainty that if there is a bug in either Util.split() or Perl5Util.split() it will not mysteriously limit itself to input longer than 256 characters (you can tell this simply by doing a code read of the split() methods). Either there is a major bug in whichever split() you're using or there's a mistake in your code. I can tell you from many years of debugging other people's code (and mine as well!), that even without seeing your code, based on your description, the problem probably lies in your code; although the root of the problem may be a misunderstanding based on unclear API documentation and the lack of a proper user's guide. My guess is it's an issue with the split pattern you're using, the split limit you're using, or a misunderstanding of what gets stored in the resulting Collection (Perl5Util.split() saves matching subgroups but Util.split() doesn't). For what it's worth, java splitExample '[\s#]' "`cat ~/.bashrc`" behaves correctly and my .bashrc has over 13,000 characters in it. daniel -- To unsubscribe, e-mail: <mailto:[email protected]> For additional commands, e-mail: <mailto:[email protected]>