You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2018/06/11 14:23:00 UTC

[jira] [Resolved] (LANG-1399) Split fails on word boundaries

     [ https://issues.apache.org/jira/browse/LANG-1399?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved LANG-1399.
------------------------
    Resolution: Invalid

StringUtils.split treats the separator as a String, not a regular expression.

So "\b" does not mean word-boundary.

> Split fails on word boundaries
> ------------------------------
>
>                 Key: LANG-1399
>                 URL: https://issues.apache.org/jira/browse/LANG-1399
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.*
>    Affects Versions: 3.x
>         Environment: Produced on v3.7 with Java 8, running Windows. But this may be produced in any environment
>            Reporter: devson
>            Priority: Major
>
> StringUtils.split does not behave correctly when the split is to be performed on word boundary characters ("\b"). Steps to produce the bug:
> String string = "foo<bar>foofoo";
> String[] st=StringUtils.split(string, "\b");
> Expected o/p:
> foo
> <
> bar
> >
> foofoo
>  
> Actual o/p:
> foo<bar>foofoo
> The issue seems to be with how zero-width separators are being handled. Note that Java library's String.split gives the expected output.
> Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)