Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread C.DeRykus
On Aug 25, 7:01 am, jwkr...@shaw.ca ("John W. Krahn") wrote: > Honza Mach wrote: > > Hi everybody, > > Hello, > > > > > > > > > > > I was wondering, if it is possible to use backreferences in the pattern > > repetition bracket operator. > > > Consider the following string: > > > my $string = "5 abc

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Randal L. Schwartz
> "Honza" == Honza Mach writes: Honza> Hi everybody, In the subject, you mention "PCRE". Are you actually using PCRE, and not Perl? If so, this mailing list isn't for you, because PCRE is misnamed: it isn't Perl, and it's not even Perl Compatible. This mailing list will likely give you Per

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread John W. Krahn
Honza Mach wrote: Hi everybody, Hello, I was wondering, if it is possible to use backreferences in the pattern repetition bracket operator. Consider the following string: my $string = "5 abcdefghijklmn"; The number five at the beginning of the string means, that I want to extract first fiv

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Honza Mach
Hi, On Thu, 2011-08-25 at 12:54 +0200, Paul Johnson wrote: > On Thu, Aug 25, 2011 at 12:02:37PM +0200, Honza Mach wrote: > > Hi, > > > > On Thu, 2011-08-25 at 11:35 +0200, Paul Johnson wrote: > > > > > > say "extracted: ", /^(\d+\s+.{$len})/ if ($len) = /^(\d+)/ > > > Sometimes two passes are

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Paul Johnson
On Thu, Aug 25, 2011 at 12:02:37PM +0200, Honza Mach wrote: > Hi, > > On Thu, 2011-08-25 at 11:35 +0200, Paul Johnson wrote: > > > > say "extracted: ", /^(\d+\s+.{$len})/ if ($len) = /^(\d+)/ > > Sometimes two passes are are better than one. > > > > Thank you for your advice, however I wanted

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Honza Mach
Hi, On Thu, 2011-08-25 at 11:35 +0200, Paul Johnson wrote: > > > On Thu, 25 Aug 2011 10:42:20 +0200 > > > Honza Mach wrote: > > > > > > > Hi everybody, > > > > > > > > I was wondering, if it is possible to use backreferences in the pattern > > > > repetition bracket operator. > > > > > > > > C

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Paul Johnson
> > On Thu, 25 Aug 2011 10:42:20 +0200 > > Honza Mach wrote: > > > > > Hi everybody, > > > > > > I was wondering, if it is possible to use backreferences in the pattern > > > repetition bracket operator. > > > > > > Consider the following string: > > > > > > my $string = "5 abcdefghijklmn"; >

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Honza Mach
Hi Schlomi, thank you so much for such a quick response. On Thu, 2011-08-25 at 11:56 +0300, Shlomi Fish wrote: > ׁHi Honza, > > On Thu, 25 Aug 2011 10:42:20 +0200 > Honza Mach wrote: > > > Hi everybody, > > > > I was wondering, if it is possible to use backreferences in the pattern > > repeti

Re: PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Shlomi Fish
ׁHi Honza, On Thu, 25 Aug 2011 10:42:20 +0200 Honza Mach wrote: > Hi everybody, > > I was wondering, if it is possible to use backreferences in the pattern > repetition bracket operator. > > Consider the following string: > > my $string = "5 abcdefghijklmn"; > > The number five at the beginn

PCRE: Use backreference in pattern repetition bracket

2011-08-25 Thread Honza Mach
Hi everybody, I was wondering, if it is possible to use backreferences in the pattern repetition bracket operator. Consider the following string: my $string = "5 abcdefghijklmn"; The number five at the beginning of the string means, that I want to extract first five characters from the latter p