On 4/17/06, Eric Arnold <[EMAIL PROTECTED]> wrote:
> Are you saying that your substitution works for one file but not for
> many with argo?
>
> Anyway, specifying ^M isn't very portable, so you probably want
> \n instead. Also, you can save yourself using \/ everywhere by using
>
> :s;pattern1;pattern2;ge
>
> Using \s* or \s\+ instead of entering literal tabs or spaces can
> also save some headaches.
>
> You may also be getting into some trouble using the \& branch syntax.
> It's tricky (I've rarely used it) and it isn't clear in your example
> that it's being used correctly to "and" together the different pattern
> segments. I could be confusing some syntax related to nbsp, but I
> don't think you want the \ if you want to match   literally.
>
> Save some typing using \d\d\d\d or \d\{4} instead of [0-9]...
>
>
> On 4/16/06, Mike Blonder <[EMAIL PROTECTED]> wrote:
> > Hi.
> >
> > I am unable to successfully use args & argdo to change many files for a
> > specific pattern that spans 3 lines. The files are .htm files.
> >
> > I have used set listchars=:tab>-,trail:- to reveal the tabs within the
> > file and have included what I take to be precisely the pattern within
> > the argdo statement:
> >
> > argdo %s/>------>------<\/tr>^M>------>------ <td valign="middle"
> > height="22"><font size="1">\ <img src="\/images\/arrowright.gif"
> > border=0 alt="[0-9][0-9][0-9][0-9]">\ <a
> > href="\/What_is_New.htm">What's New?<\/a><\/font<\/td>^M//ge | update
> >
> > The [0-9][0-9][0-9][0-9] represents 4 digits that are in each iteration
> > of the line but 4 digits that change from file to file. The ^Ms are
> > properly expresses with at <ctrl> V <ctrl> M sequences.
> >
> > Am I missing, perhaps an end of line character?
Change \& to plain &. Literal & does not need to be escaped in the 'pattern'
part of s///. \& means something different, as Eric mentioned.
Yakov