[
https://issues.apache.org/jira/browse/LANG-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17343775#comment-17343775
]
Alex Ivashchenko edited comment on LANG-1658 at 5/13/21, 8:37 AM:
------------------------------------------------------------------
Hi, [~misha2048]!
Do we need to search only for decimal numbers or look for hex, oct and binary
numbers as well?
was (Author: oivalex):
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)