[GitHub] [commons-lang] aherbert commented on pull request #727: LANG-1644 - Check if number is hexadecimal

2021-03-04 Thread GitBox
aherbert commented on pull request #727: URL: https://github.com/apache/commons-lang/pull/727#issuecomment-790912955 The value `5D0` may be valid hex digits but what are you going to do with that fact? If you want to create a number with it then nothing in NumberUtils or the Java language

[GitHub] [commons-lang] aherbert commented on pull request #727: LANG-1644 - Check if number is hexadecimal

2021-03-04 Thread GitBox
aherbert commented on pull request #727: URL: https://github.com/apache/commons-lang/pull/727#issuecomment-790806626 Regarding `0x1L` the NumberUtils.createNumber and NumberUtils.isCreatable only supports the preferred type suffix on decimal numbers. You cannot specify a preferred `L` for

Re: [GitHub] [commons-lang] aherbert commented on pull request #727: LANG-1644 - Check if number is hexadecimal

2021-03-03 Thread Alex Herbert
Sorry, the previous simple regex was incorrect. It should have at least 1 character after the x: 0[xX][0-9a-fA-F]{1,16} Anyway, parsing a number by code or regex has a lot of cases to consider and the intent should be documented. On Thu, 4 Mar 2021 at 00:47, Alex Herbert wrote: > It also makes

Re: [GitHub] [commons-lang] aherbert commented on pull request #727: LANG-1644 - Check if number is hexadecimal

2021-03-03 Thread Alex Herbert
It also makes me ask if we are adding this then why not methods to query the other Java formats for literals: Binary = 0b... Octal = 0... Hex = 0x... isBinaryLiteral() isOctalLiteral() isHexLiteral() It also assumes that the number is an integer. But the binary literal formats cover floating

Re: [GitHub] [commons-lang] aherbert commented on pull request #727: LANG-1644 - Check if number is hexadecimal

2021-03-03 Thread Gary Gregory
I am not convinced this belong in Lang. Maybe in a Math module? Maybe in Text? Gary On Wed, Mar 3, 2021, 19:29 GitBox wrote: > > aherbert commented on pull request #727: > URL: > https://github.com/apache/commons-lang/pull/727#issuecomment-790185530 > > >Is the intention that this should

[GitHub] [commons-lang] aherbert commented on pull request #727: LANG-1644 - Check if number is hexadecimal

2021-03-03 Thread GitBox
aherbert commented on pull request #727: URL: https://github.com/apache/commons-lang/pull/727#issuecomment-790185530 Is the intention that this should match `isCreateable(String)` for all valid hex numbers and return `true` for all hex cases where a `Number` is returned from