"Jenda Krynicky" schreef:
> I did not know they were silly enough to
> include some additional unicode characters in \d, I expected those to
> be only in the [[:IsNumber:]].
IsNumber is about number characters, also including encircled digits and
the Latin I.
The why is on unicode.org. (or google
Jenda Krynicky wrote:
>
> Thanks for the \d info, I did not know they were silly enough to
> include some additional unicode characters in \d, I expected those to
> be only in the [[:IsNumber:]].
>
> It's really sily as there really are characters that match /^\d$/,
> yet $char+0 issues a "Argum
On 15 Oct 2007 at 20:43, Dr.Ruud wrote:
> Jenda Krynicky schreef:
> > Dr.Ruud:
>
> >> [$version =~ s/^(Version:\s*(?:\d+\.)*)(\d+)/$1 . ($2+1)/e;]
> >>
> >> - you are using string evaluation. (read perlretut again)
> >
> > No I'm not. It's a single /e, not double /ee. The stuff inside the
> > matc
On 10/15/07, Dr.Ruud <[EMAIL PROTECTED]> wrote:
> Jenda Krynicky schreef:
> > Dr.Ruud:
>
> >> [$version =~ s/^(Version:\s*(?:\d+\.)*)(\d+)/$1 . ($2+1)/e;]
> >>
> >> - you are using string evaluation. (read perlretut again)
> >
> > No I'm not. It's a single /e, not double /ee. The stuff inside the
>
Jenda Krynicky schreef:
> Dr.Ruud:
>> [$version =~ s/^(Version:\s*(?:\d+\.)*)(\d+)/$1 . ($2+1)/e;]
>>
>> - you are using string evaluation. (read perlretut again)
>
> No I'm not. It's a single /e, not double /ee. The stuff inside the
> matched string is not evaluated as Perl code. Read perlretut a
Jenda Krynicky schreef:
> Dr.Ruud:
>> - be careful when to use \d, that set can contain more than 100
>> characters.
>
> Beg your pardon?
I write [0-9] when I mean [0-9]. Many Perl developers keep thinking that
\d and [0-9] are equivalent.
Check out http://www.xs4all.nl/~rvtol/perl/unicount.pl
From: "Dr.Ruud" <[EMAIL PROTECTED]>
> "Jenda Krynicky" schreef:
>
> > Having a string like this:
> >
> > $version = 'Version: 1.47.785';
> >
> > increment the last number. I seriously doubt you can do anything even
> > remotely as simple as
> >
> > $version =~ s/^(Version:\s*(?:\d+\.)*)(\d+)/$1
Dr.Ruud wrote:
> Well, don't underestimate version number logic. Version numbers can also
> be like "1.23.045_21".
>
> Yes, v-strings are deprecated, but supporting version number logic
> isn't. Again: see version.pm.
> (the C-version is 6k, the Perl version is 11k)
>
>
I'm not underestimating v
"Jenda Krynicky" schreef:
> Having a string like this:
>
> $version = 'Version: 1.47.785';
>
> increment the last number. I seriously doubt you can do anything even
> remotely as simple as
>
> $version =~ s/^(Version:\s*(?:\d+\.)*)(\d+)/$1 . ($2+1)/e;
- never trust your own (often temporary) d
Matthew Whipple schreef:
> My response was actually due to my lack of knowledge
> about Perl's v-strings and therefore I viewed your treatment from a
> more logical perspective.
The building blocks of Perl Version Strings are just characters.
$ perl -wle 'print 65.66.67'
ABC
$ perl -wle 'print
Sorry I prefer messages where the point is easily visible rather than
having to scroll down to the bottom of a thread of things that people
have read several times over and don't see the need to place simple
concepts in context (particularly when sufficient context is left
afterward). My response
From: "Dr.Ruud" <[EMAIL PROTECTED]>
> "Jenda Krynicky" schreef:
> > Dr.Ruud:
> > Try
> >
> > print( (1.2.3 eq '1.2.3') ? 'yes' : 'no');
>
> $ perl -wle 'print sprintf("%vd", 1.2.3) eq "1.2.3" ? "y" : "n"'
> y
So you proved that you can convert a version string into an ordinary
one. Now the o
"Jenda Krynicky" schreef:
> Dr.Ruud:
>> Matthew Whipple:
>>> Dr.Ruud:
Tatiana Lloret Iglesias:
> What regular expression do I need to convert
> Version: 1.2.3 to
> Version: 1.2.4 ?
>
> I.e. my pattern is Version: number.number.number and from that i
> need Version:
Dr.Ruud wrote:
"Tatiana Lloret Iglesias" schreef:
What regular expression do I need to convert Version: 1.2.3 to
Version:
1.2.4 ?
I.e. my pattern is Version: number.number.number and from that i need
Version: number.number.number+1
After the : i can have a space or not...
Why use a rege
From: "Dr.Ruud" <[EMAIL PROTECTED]>
> Matthew Whipple schreef:
> > Dr.Ruud:
> >> Tatiana Lloret Iglesias:
>
> >>> What regular expression do I need to convert Version: 1.2.3 to
> >>> Version:
> >>> 1.2.4 ?
> >>>
> >>> I.e. my pattern is Version: number.number.number and from that i
> >>> nee
Matthew Whipple schreef:
> Dr.Ruud:
>> Tatiana Lloret Iglesias:
>>> What regular expression do I need to convert Version: 1.2.3 to
>>> Version:
>>> 1.2.4 ?
>>>
>>> I.e. my pattern is Version: number.number.number and from that i
>>> need Version: number.number.number+1
>>> After the : i can
This wouldn't scale past double digits. If you're going to separate it
out you may as well break the minor revisions into it's own variable and
then concatenate/format on output...that would also be more easily used
with a code management system's built in revision tracking (though this
could also
"Tatiana Lloret Iglesias" schreef:
> What regular expression do I need to convert Version: 1.2.3 to
> Version:
> 1.2.4 ?
>
> I.e. my pattern is Version: number.number.number and from that i need
> Version: number.number.number+1
> After the : i can have a space or not...
Why use a regex?
pe
On Oct 10, 2:39 pm, [EMAIL PROTECTED] (Tatiana Lloret Iglesias)
wrote:
> Hi all!
>
> What regular expression do I need to convert Version: 1.2.3 to Version:
> 1.2.4 ?
>
> I.e. my pattern is Version: number.number.number and from that i need
> Version: number.number.number+1
> After the : i can
Thanks a lot !!
T
On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> Tatiana Lloret Iglesias wrote:
> >
> > Hi all!
> >
> > What regular expression do I need to convert Version: 1.2.3 to
> Version:
> > 1.2.4 ?
> >
> > I.e. my pattern is Version: number.number.number and from that i need
$ perl -e '$x="Version: 1.2.3";$x=~s/(Version:
\d+\.\d+\.)(\d+)/$1.($2+1)/e;print $x'
Version: 1.2.4
2007/10/10, Tatiana Lloret Iglesias <[EMAIL PROTECTED]>:
> Hi all!
>
> What regular expression do I need to convert Version: 1.2.3 to Version:
> 1.2.4 ?
>
> I.e. my pattern is Version: number.
Or
You can also do ...
$string =~ s/(\d+)$/$1+1/e;
Ashok
On 10/10/07, Rob Dixon <[EMAIL PROTECTED]> wrote:
>
> Tatiana Lloret Iglesias wrote:
> >
> > Hi all!
> >
> > What regular expression do I need to convert Version: 1.2.3 to
> Version:
> > 1.2.4 ?
> >
> > I.e. my pattern is Version: num
Tatiana Lloret Iglesias wrote:
Hi all!
What regular expression do I need to convert Version: 1.2.3 to Version:
1.2.4 ?
I.e. my pattern is Version: number.number.number and from that i need
Version: number.number.number+1
After the : i can have a space or not...
Hello Tatiana
This will
23 matches
Mail list logo