kanish has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks
I have a variable which contains perl coding.
I need to get find patter and replace patter into variabls from $text variable.$a=' $text=~s#Find \#Text#Replace Text#; $text=~s/Find \/Text/Replace Text/; $text=~s{Find \}Text}{Replace Text}; ';
if ($a=~m#$text=~s(.)\s*(?<!\1)#) { # need value $findtext='Find \#Text'; # need value $repltext='Replace Text'; }
when I ran this, It will showing an error message.
Variable length lookbehind not implemented in regex; marked by <-- HER +E in m/=~\s*s(.)(?<!\1) <-- HERE / at script.pl line 8 (#1) (F) Lookbehind is allowed only for subexpressions whose length is +fixed and known at compile time. The <-- HERE shows in the regular expressio +n about where the problem was discovered. See perlre. Uncaught exception from user code: Variable length lookbehind not implemented in regex; marked by + <-- HERE in m/=~\s*s(.)(?<!\1) <-- HERE / at script.pl line 8.
Please guide me how can i do this.
Thanks
Kanishk
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regexp help!!
by inman (Curate) on Oct 21, 2005 at 11:30 UTC | |
by Roy Johnson (Monsignor) on Oct 21, 2005 at 14:02 UTC | |
|
Re: Regexp help!!
by Samy_rio (Vicar) on Oct 21, 2005 at 11:28 UTC | |
|
Re: Regexp help!!
by Util (Priest) on Oct 22, 2005 at 01:32 UTC | |
|
Re: Regexp help!!
by ambrus (Abbot) on Oct 21, 2005 at 15:15 UTC |