You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary D. Gregory (Jira)" <ji...@apache.org> on 2023/07/02 14:50:00 UTC

[jira] [Comment Edited] (LANG-1658) Create new method to search for numbers within string

    [ https://issues.apache.org/jira/browse/LANG-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17739381#comment-17739381 ] 

Gary D. Gregory edited comment on LANG-1658 at 7/2/23 2:49 PM:
---------------------------------------------------------------

1: I really don't think this belongs in Commons Lang, maybe in Commons Number, or Commons Text, but not here. The best place to discuss this is on the dev mailing list.


was (Author: garydgregory):
1: I really don't think https://issues.apache.org/jira/browse/LANG-1658 belongs in Commons Lang, maybe in Commons Number, or Commons Text, but not here. The best place to discuss this is on the dev mailing list.

> Create new method to search for numbers within string
> -----------------------------------------------------
>
>                 Key: LANG-1658
>                 URL: https://issues.apache.org/jira/browse/LANG-1658
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Mikhail Polivakha
>            Priority: Minor
>
> I have encountered in my work with a requirement to parse string and fetch all of the numbers from it (may be integers, may be float). I guess, perhaps it will be helpful for comunity. 
> Example of  use cases:
> 1) Input: " Duration : 12.3 days, 34minutes"
>     Output: [12.3, 34.0]
> 2) Input: " Weight is 76 and height is 180.2 cm"
>     Output : [76.0, 180.2]
> 3) Input: "Between 12.22 and 90"
>     Output: [12.22, 90]
> 4) Input: "First: 1289.0 Second: 9283.112 Third: 281"
>     Output : [1289.0, 9283.112, 281.0]
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)