You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Alex Ivashchenko (Jira)" <ji...@apache.org> on 2021/05/13 08:25:00 UTC
[jira] [Commented] (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=17343775#comment-17343775 ]
Alex Ivashchenko commented on LANG-1658:
----------------------------------------
Hi, [~misha2048]!
Do we need to search only for decimal numbers or look for hex and oct numbers as well?
> 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.*
> Affects Versions: 3.12.0
> 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.3.4#803005)