Re: Beginner Reg.Expression Question

2007-10-16 Thread Dr.Ruud
"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

Re: Beginner Reg.Expression Question

2007-10-16 Thread Matthew Whipple
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

Re: Beginner Reg.Expression Question

2007-10-16 Thread Jenda Krynicky
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

Re: Beginner Reg.Expression Question

2007-10-15 Thread Chas. Owens
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 >

Re: Beginner Reg.Expression Question

2007-10-15 Thread Dr.Ruud
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

Re: Beginner Reg.Expression Question

2007-10-15 Thread Dr.Ruud
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

Re: Beginner Reg.Expression Question

2007-10-14 Thread Jenda Krynicky
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

Re: Beginner Reg.Expression Question

2007-10-13 Thread Matthew Whipple
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

Re: Beginner Reg.Expression Question

2007-10-13 Thread Dr.Ruud
"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

Re: Beginner Reg.Expression Question

2007-10-13 Thread Dr.Ruud
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

Re: Beginner Reg.Expression Question

2007-10-12 Thread Matthew Whipple
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

Re: Beginner Reg.Expression Question

2007-10-12 Thread Jenda Krynicky
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

Re: Beginner Reg.Expression Question

2007-10-12 Thread Dr.Ruud
"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:

Re: Beginner Reg.Expression Question

2007-10-12 Thread Rob Dixon
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

Re: Beginner Reg.Expression Question

2007-10-12 Thread Jenda Krynicky
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

Re: Beginner Reg.Expression Question

2007-10-12 Thread Dr.Ruud
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

Re: Beginner Reg.Expression Question

2007-10-10 Thread Matthew Whipple
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

Re: Beginner Reg.Expression Question

2007-10-10 Thread Dr.Ruud
"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

Re: Beginner Reg.Expression Question

2007-10-10 Thread dinesh
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

Re: Beginner Reg.Expression Question

2007-10-10 Thread Tatiana Lloret Iglesias
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

Re: Beginner Reg.Expression Question

2007-10-10 Thread Jeff Pang
$ 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.

Re: Beginner Reg.Expression Question

2007-10-10 Thread Ashok Varma
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

Re: Beginner Reg.Expression Question

2007-10-10 Thread Rob Dixon
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