[ https://issues.apache.org/jira/browse/LANG-910?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell updated LANG-910: ------------------------------- Attachment: LANG-910.patch I cleaned up the javadoc and added another method: public static String[] substringsMatches(final String str, Pattern pattern) { Then hit some pain because there is only one matching group in "(.)" in Java :( I've attached my patch. My only concern is whether we should be addressing the above. Should we provide an API that works more naturally such that there are 6 matching groups in "foobar"->match("(.)") instead of only one? Then you can say substring(4) and get "bar" back (noting matching groups are 1-indexed and not 0-indexed? > Patch to extend StringUtils > --------------------------- > > Key: LANG-910 > URL: https://issues.apache.org/jira/browse/LANG-910 > Project: Commons Lang > Issue Type: Bug > Components: lang.* > Affects Versions: 3.1 > Environment: Developed on Ubuntu 13.04 with openjdk 7u25 > Reporter: Timur Yarosh > Labels: patch > Fix For: 3.2 > > Attachments: LANG-910.patch, > substring-matches-and-white-space-normalize.patch > > > This patch extends StringUtils capabilities: added methods to find > substring(s) by Pattern. Also method > org.apache.commons.lang3.StringUtils#normalizeSpace now replaces ASCII #160 > char to normal whitespace. -- This message was sent by Atlassian JIRA (v6.1#6144)