Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 38612 invoked from network); 27 Apr 2010 07:24:03 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Apr 2010 07:24:03 -0000 Received: (qmail 29608 invoked by uid 500); 27 Apr 2010 07:24:03 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 29271 invoked by uid 500); 27 Apr 2010 07:24:00 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 29262 invoked by uid 99); 27 Apr 2010 07:23:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Apr 2010 07:23:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Apr 2010 07:23:57 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3R7NZws023490 for ; Tue, 27 Apr 2010 07:23:36 GMT Message-ID: <24693686.27601272353015618.JavaMail.jira@thor> Date: Tue, 27 Apr 2010 03:23:35 -0400 (EDT) From: "Henri Yandell (JIRA)" To: issues@commons.apache.org Subject: [jira] Closed: (LANG-619) String prefixing/suffixing In-Reply-To: <8003906.9311271426308018.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-619?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Henri Yandell closed LANG-619. ------------------------------ Resolution: Won't Fix Closing as a wontfix. I think this is complex enough that it's worth using regex's instead of code. I strongly recommend Friedl's Mastering Regular Expressions book - the most valuable computer book I've ever read. > String prefixing/suffixing > -------------------------- > > Key: LANG-619 > URL: https://issues.apache.org/jira/browse/LANG-619 > Project: Commons Lang > Issue Type: New Feature > Components: lang.* > Affects Versions: 2.5 > Reporter: Stephan van Hugten > Attachments: StringExtendedUtils.zip > > > I had a use case that I wanted to search through a string and, when I found a match, prefix or suffix (or both) the matching term, i.e. to apply a highlighting class to a matching keyword in a search. > I noticed that this cannot be done by the StringUtils framework, so me and a colleague made this code and would like to donate it to the StringUtils project. In the attachment I included the class with the extensions plus a Unit test testing all the usecases. I hope you like it. > There are 3 methods in the attached class: > prefix: searches through a string and prefixes a match > suffix: searches through a string and suffixes a match > around: does both, prefix or suffix may be null. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.