Re: Regex lookahead problem

2005-01-14 Thread Dave Gray
On Fri, 14 Jan 2005 07:11:30 +, Andrew Black <[EMAIL PROTECTED]> wrote: > Can someone explain how lookaheads work and give an example of using one > Cheers I find the full names of these regex constructs to be quite enlightening: "zero-width (positive|negative) look-(ahead|behind) assertion".

Re: Regex lookahead problem

2005-01-14 Thread Andrew Black
Can someone explain how lookaheads work and give an example of using one Cheers -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Regex lookahead problem

2005-01-11 Thread Jenda Krynicky
From: Ramprasad A Padmanabhan <[EMAIL PROTECTED]> > I have a string > > $X='#SOME_STRING END'; > > I want to remove the begining '#' and ending 'END' but retain > everything in between. > > > This way works fine > $X=~s/^#(.*?) END$/$1/; # $X is now SOME_STRING > > But this wa

Regex lookahead problem

2005-01-11 Thread Ramprasad A Padmanabhan
I have a string $X='#SOME_STRING END'; I want to remove the begining '#' and ending 'END' but retain everything in between. This way works fine $X=~s/^#(.*?) END$/$1/; # $X is now SOME_STRING But this way does not s/^#(?=.*) END$//; ## $X is still #SOME_