Re: substitution
- From: rvtol+news@xxxxxxxxxxxx (Dr.Ruud)
- Date: Fri, 4 Jul 2008 12:20:03 +0200
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."
.
- References:
- substitution
- From: Epanda
- Re: substitution
- From: Dr.Ruud
- Re: substitution
- From: Epanda
- substitution
- Prev by Date: Re: mysql data store in to a FILE
- Next by Date: Optimize the script
- Previous by thread: Re: substitution
- Next by thread: Array problem
- Index(es):
Relevant Pages
|