From: Victor Porton <porton@narod.ru>
Subject: Re: Comparing version numbers
Date: Mon, 13 Nov 2017 17:56:14 +0200
Date: 2017-11-13T17:56:14+02:00 [thread overview]
Message-ID: <oucfat$1qrb$1@gioia.aioe.org> (raw)
In-Reply-To: oubk2a$7mb$1@gioia.aioe.org
Dmitry A. Kazakov wrote:
> On 13/11/2017 03:39, Victor Porton wrote:
>> Not sure if it is quite on-topic, because it is more about general
>> programming ideas rather than about Ada. (However, a solution in Python
>> or Ruby or JavaScript would more likely used regexps than Ada.)
>
> I doubt regular expressions would help here, or any other kind of text
> patterns language. It is not a pattern matching problem.
>
>> Suppose I have two version numbers of a software. I need to check which
>> of the two is greater.
>>
>> Lexical order string comparison does not work:
>>
>> "2.3" vs "11.4".
>>
>> I could split it by "." and compare the numbers. But a component of a
>> version numbers may be nonnumeric like:
>>
>> "1.2beta".
>>
>> What to do?
>
> Is it what you are looking for:
>
> http://www.dmitry-kazakov.de/ada/strings_edit.htm#11
Yes.
But what is the difference between Compare_Textually and
Compare_Lexicographically?
"This function compares two strings as texts." What does "compares as text"
mean?
--
Victor Porton - http://portonvictor.org
next prev parent reply other threads:[~2017-11-13 15:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 2:39 Comparing version numbers Victor Porton
2017-11-13 5:15 ` J-P. Rosen
2017-11-13 8:04 ` briot.emmanuel
2017-11-13 11:11 ` Simon Wright
2017-11-13 21:30 ` briot.emmanuel
2017-11-13 8:10 ` Dmitry A. Kazakov
2017-11-13 15:56 ` Victor Porton [this message]
2017-11-13 17:22 ` Dmitry A. Kazakov
2017-11-13 18:54 ` Victor Porton
2017-11-13 20:25 ` Dmitry A. Kazakov
2017-11-16 15:33 ` Robert Eachus
2017-11-17 14:45 ` Shark8
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox