Re: substitution



epanda schreef:

Don't top post. Don't quote signatures and other trailers.

rvtol:
epanda:

I want to replace my pattern by the corresponding value of the key
in the hash table [...]
with a single %s/pattern/hashpattern/g expression

Why that last condition? Sounds like homework.
And is unsound: often you want to do the longest possible change
first.

It is ok I have found the good one substitution for me but I am
amazing that perl is not as clever as vimscript regex in limitation of
assertions.

Define "clever". I think you just need to look much more into the
matter.


ex : perl is lost when I want to say that a digit has to not be
preceed by this sentence :
<aWord><aCharacter><aComma><aNumberOfUndefinedSpaces>
/(?<!FRUIT.;\s*)\b(\d+)
|_______________________the pb is here

I don't see why you have a "\b" in there.

Should "FRUIT." match patterns like "FRUITS" and "FRUITY"?

First you say <aComma>, then you show a semicolon.

Now come up with actual example where you had a problem with.

--
Affijn, Ruud

"Gewoon is een tijger."

.



Relevant Pages

  • Re: Not Going Out - Not Watching Again
    ... something better because I don't claim to be clever ... I am always suspicious of anything that involves Tim Vine. ... Like I said in my post last Saturday, judging by the two trailers I'd ... the Playground where Justin Lee Collins eclipsed him for crapness) ...
    (uk.media.tv.misc)
  • Re: Penn State Soaring Club Glider ***STOLEN***
    ... I keep hoping this is a very clever April Fools...in ... long, skinny, funny looking trailers that carry aircraft. ... Police who pulled Karl over to check his paperwork. ...
    (rec.aviation.soaring)
  • Re: AW: Question.....unsubscribe
    ... Hash: SHA1 ... > might be more clever to delete them before they're send. ... jxl/CLjRoJgivjIQrpFq4xA= ...
    (Debian-User)
  • Re: Inverting a hash safely
    ... Instead I would return just one hash. ... To invert such a hash would mean you want to find the markup for the content. ... The only possible reason for doing this is that someone tried to be clever and stuffed some content into the markup, which now has to be extracted. ...
    (perl.beginners)
  • array of numbers with padded zeroes
    ... I'm having trouble with this, and I'm sure someone out there has a really ... clever solution-- ... I have a hash, %data, with, say, 32 elements. ...
    (perl.beginners)